Important question for reading File

Good morning

i need help...

any one know 1 class for oper all document?

example:

http:sitoclient.com/?file?filename.txt

or

/home/class/filename.txt

i need 1 class for open file in all mode

where is this class?

one class for read file in url or in absolute path

Message was edited by:

mirko81

[366 byte] By [mirko81a] at [2007-11-27 2:38:03]
# 1
java.net.URLuse the file: protocol to access files.
ejpa at 2007-7-12 2:58:50 > top of Java-index,Core,Core APIs...
# 2

ok i know this class but i not know where insert Java.net in my code....

and i need use class BufferReader for other problem...

where insert Java.net.URL ?

String keyCode = "";

BufferedReader file = new BufferedReader(new FileReader(keyFile));

if(file.read() > 0)

{

int i = 0;

String appKey = file.readLine();

for(i=0;i<500;i++)

{

char c = appKey.charAt(0);

if(c==' '| c=='#')

{

appKey = file.readLine();

}

else

{

keyCode = keyCode + appKey;

appKey= file.readLine();

char cd = appKey.charAt(0);

if(cd==' '| cd=='#')break;

}

}

}

else

{

System.out.println("File corrotto o non presente");

}

mirko81a at 2007-7-12 2:58:50 > top of Java-index,Core,Core APIs...
# 3

Is that code really supposed to ignore the first character in the file?

As you know the URL class, you will be familiar with http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html#openStream()

or

http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html#openConnection()

and http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLConnection.html#getInputStream()

and also http://java.sun.com/j2se/1.5.0/docs/api/java/io/InputStreamReader.html.

ejpa at 2007-7-12 2:58:51 > top of Java-index,Core,Core APIs...
# 4
mmm ok but is not possible use tmp in unix whit this class
mirko81a at 2007-7-12 2:58:51 > top of Java-index,Core,Core APIs...
# 5
(a) what does 'use tmp in unix' have to do with this question? (b) what does it mean?
ejpa at 2007-7-12 2:58:51 > top of Java-index,Core,Core APIs...
# 6
when file input is not a url es: /directory/file.txt whitout file://
mirko81a at 2007-7-12 2:58:51 > top of Java-index,Core,Core APIs...
# 7
err, put file: on the front? could that be it? is it really that simple? have you tried it? or would you rather waste your time waiting for answers on the forum? You've been at this since 28 April and you had that particular answer on the 30th.
ejpa at 2007-7-12 2:58:51 > top of Java-index,Core,Core APIs...