Solved

Client-side file parsing

Posted on 2010-08-25
17
376 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
endX challenge 2 50
countAbc challenge 9 49
wordmultiple challenge 12 90
what is the difference between "sudo su" and "su - root" 6 75
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

760 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

20 Experts available now in Live!

Get 1:1 Help Now