Re: Java Applet saving results on home server
- From: rizwindu <bgeorge@xxxxxxxxx>
- Date: Thu, 14 Jun 2007 11:08:59 -0000
On Jun 13, 2:46 pm, Lew <l...@xxxxxxxxxxxxxxxx> wrote:
rizwindu wrote:
"Andrew Thompson" wrote:
rizwindu wrote:Class files? Configuration files? What files?
Lew wrote:Either would do really. Could store the results in a class and write
that. I can also store the results to a string and write that to a
file.
On the face of it that doesn't make sense. What sort of "results" are you
getting, and how to you envision that it would be stored to a class? Are
these results bytecode?
rizwindu wrote:If they are bytecode, then how do you envision they be encoded into a String?
My results are a mix of strings, arrays etc. I can write them to a
file by outputting the text nicely. Or I can make a 'Results' class
that has some data structures to store all the things I need, then I
can create a new Results object, and save the results object.
That clears up my misunderstanding. You had said you'd save it as a "class
file", but your explanation that that is not what you intend clears up the matter.
Saving an object only begs the question. You still have to decide whether to
save as raw strings, Properties or XML files, to name three text options, or
as a serialized binary object, or with some other encoding scheme (Base64,
uuencode, ...). This puts you right back into your original question.
--
Lew
Hi,
I've got a problem with the Jakarta ftp client.
I can open a file stream and save one file to the server, but if I try
and save a second file it doesn't work.
<CODE>
// Connect and login
FTPClient ftp = new FTPClient();
ftp.connection(SERVER_IP);
ftp.login(USERNAME, PASSWORD);
// Save a text file
OutputStream text_os = ftp.storeFileStream(FILENAME + ".txt");
DataOutputStream text_dos = new DataOutputStream(text_os);
text_dos.writeChars(OUTPUT_STRING);
text_dos.close();
text_os.close();
// Save an object
OutputStream object_os ftp.storeFileStream(FILENAME + ".object");
ObjectOutputStream object_oos = new ObjectOutputStream(object_os);
object_oos.writeObject(results);
object_oos.close();
object_os.close();
// Logout and close
ftp.logout();
ftp.disconnect();
</CODE>
It saves the first stream correctly, but the second call of
ftp.storeFileStream return null, which apparently happens if "the data
connection cannot be opened (e.g., the file does not exist)".
If I change the order in which the files are written, still the first
one is written but the second isn't.
.
- Follow-Ups:
- Re: Java Applet saving results on home server
- From: Gordon Beaton
- Re: Java Applet saving results on home server
- References:
- Java Applet saving results on home server
- From: rizwindu
- Re: Java Applet saving results on home server
- From: Lew
- Re: Java Applet saving results on home server
- From: rizwindu
- Re: Java Applet saving results on home server
- From: Lew
- Java Applet saving results on home server
- Prev by Date: Re: System.currentTimeMillis() out of sync with servertime (?)
- Next by Date: Re: Java Applet saving results on home server
- Previous by thread: Re: Java Applet saving results on home server
- Next by thread: Re: Java Applet saving results on home server
- Index(es):
Relevant Pages
|