?
Solved

Client-side file parsing

Posted on 2010-08-25
17
Medium Priority
?
383 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +3
17 Comments
 
LVL 10

Accepted Solution

by:
Hegemon earned 668 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 668 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

765 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