Solved

Client-side file parsing

Posted on 2010-08-25
17
379 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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
 
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle 11g 23 107
How to determine if a string is a valid SHA value 7 35
how to debug htl and js pages 8 39
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 24
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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.

828 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