Solved

Client-side file parsing

Posted on 2010-08-25
17
377 Views
Last Modified: 2013-11-24
What java technologies or strategies are available To do client-side parsing?  Basically, I have a bunch of files (600 files, 300MB worth) and each of these files contains header information as well as bmp information.  I am only interested in the header information.  Preliminary workings of this application has java code that does the parsing by reading each file's header information and creating a data structure to hold that data.  Now I am trying to turn this into a web application.  The only way I can see doing this parsing is for the client app (browser) to transfer the files to the server and do all of the parsing on the server side.  The problem is that there are a large number of files so it's not practical to send all of the files.  Is there a way to do this on the client side, i.e. compile the java into a client side application?  Any other options?
0
Comment
Question by:mock5c
  • 4
  • 3
  • 3
  • +3
17 Comments
 
LVL 10

Accepted Solution

by:
Hegemon earned 167 total points
ID: 33525296
Yes you can create a client-side application, possibly launched by Java Web Start.
0
 
LVL 3

Assisted Solution

by:gremwell
gremwell earned 167 total points
ID: 33525446
Your application could consist of a server side code and a signed Java applet. Java code bundled with the signed applet can be arranged to have access to the file system on the client side. This way it can have opportunity to parse the files locally, without uploading to the server.

Some resources:
 http://en.wikipedia.org/wiki/Java_applet - about applets, see Applet Security chapter there
 http://www.captain.at/programming/java/ - specific example of reading local files from an applet
0
 

Author Comment

by:mock5c
ID: 33525684
@Hegemon:  By Java Web Start do you mean JNLP?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33525756
>>do you mean JNLP?

Yes, it's launched by jnlp
0
 
LVL 10

Expert Comment

by:Hegemon
ID: 33526450
Yes, JNLP is another name for it.
0
 
LVL 92

Expert Comment

by:objects
ID: 33526988
> The problem is that there are a large number of files so it's not practical to send all of the files.

just zip and upload them
0
 

Author Comment

by:mock5c
ID: 33528021
The design is to not transfer the files to a remote server unless they have been validated.  That's why I can't send all the files to the server to start.  When they do get validated, zipping them prior to uploading is an excellent idea.

I'm a beginner at web programming so the whole client-server thing is throwing me off.  It sounds like my two options are applet or JNLP.  For JNLP, does that simply mean all the code is compiled and runs on the client side and thus does not require a web server at runtime?
0
 
LVL 92

Expert Comment

by:objects
ID: 33528056
no, jnlp still needs a web server.
It removes the need for the browser to be involved.
An applet may be more appropriate for your needs (assuming a browser is already involved).
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:gremwell
ID: 33528704
If you have not dealt with Java applets before, you could start developing a stand-alone Java application running on client side interacting with web server running on server. If you keep GUI simple, it can be easily package as a signed applet later on, with minimal modifications. For file upload transactions between the client and the servers you may want to stick to HTTP protocol and use POST or PUT methods.
0
 
LVL 10

Expert Comment

by:Hegemon
ID: 33529248
jnlp is only a convenience allowing to launch the application from a central storage, thus simplifying distribution problem. It may or may not be used as the application may be distributed in other ways, depending on the needs.
0
 
LVL 16

Assisted Solution

by:Valeri
Valeri earned 166 total points
ID: 33532674
>> I am only interested in the header information.
So you have to parse on the client side. Why to transfer so many MB, if you are interested in small part of this information?! So transfer only the data structures retrieved from the headers.
>> Now I am trying to turn this into a web application.
It means that the only solution is applet. Only applet will start jvm on the client side.
It will help you:
http://www.java2s.com/Code/Java/Swing-JFC/AppletandSwingComponents.htm
0
 

Author Comment

by:mock5c
ID: 33533110
@Valeri:

>> I am only interested in the header information.
>So you have to parse on the client side. Why to transfer so many MB, if you are interested in small part of >this information?!

I'm interested in validating information in the header.  If validation passes, then I'm interested in the bmp portion of the file.  If the header validation fails, the bmp is no good to me and I don't want to transfer it.

>So transfer only the data structures retrieved from the headers.

That's the problem.  How do I parse the files and create the data structure on the client side and send this information back to the server.  It is all server side now.  If applet is the solution to this, then I will research it.  Thanks for the link.


0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33534112
You can do all the validation at the client, just as you would have validated it at the server
0
 

Author Comment

by:mock5c
ID: 33534573
@CEHJ: You mean validation at the client by using applet, correct?
0
 
LVL 16

Expert Comment

by:Valeri
ID: 33556586
>> How do I parse the files and create the data structure on the client side and send this information back to the server.
Starting applet on the client side will start jvm. So you can define your own structures, to parse the files, define your own classes...everything!
As CEHJ said : "You can do all the validation at the client, just as you would have validated it at the server"
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 33556615
>>@CEHJ: You mean validation at the client by using applet, correct?

That's right
0
 
LVL 92

Expert Comment

by:objects
ID: 33557093
> @CEHJ: You mean validation at the client by using applet, correct?

you should validate at the client *and* the server
just validating client side is generally not sufficient
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
basic hardware to learn oop advanced design patterns 3 88
json example 39 130
maven project error 5 44
rhino JavaScript import, load 25 66
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now