wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes HttpConnection question ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "HttpConnection question ..." Watch "HttpConnection question ..." New topic
Author

HttpConnection question ...

Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Hi,

I'm having a small problem which is, when using FileConnection i can use the list() method to list the file of a specific folder, now am using HttpConnection so i want to list some files in the root of a web application of tomcat. how can i do that ? am trying to use FileConnection with a URL but it's throwing a runtime exception (NullPointer) ...

Please can you tell me how to do that ?

Thanks in advance ...


Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
Rashid Mayes
Ranch Hand

Joined: Jan 11, 2006
Posts: 160
The FileConnection relates to the local device file system. HttpConnection is used to exchange information with a HTTP server, the composition of the information is controlled by the client, request, and server, response.

If you have a particular folder or set of resources that you want to make available to your mobile client, I would suggest implementing a servlet that returns the desired list, pruned and machine readable.

If you plan to create the list from the file system on your server, you will need to use the java.io.File class.

The rest should be easy.

As an aside, there are other concerns such as security and how the web application is deployed.


Rashid Mayes
http://www.hostj2me.com/ - http://www.worlddeveloper.org/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpConnection question ...
 
Similar Threads
J2ME & Location Based Services
No import javax.microedition.io.Connector; in Android?
Access Local Folders
"Allow Application to read data In" Block this alert
any suggestiong for encrypting password(String)?