Re: Java Applet saving results on home server



On Jun 13, 2:46 pm, Lew <l...@xxxxxxxxxxxxxxxx> wrote:
rizwindu wrote:
"Andrew Thompson" wrote:
Class files? Configuration files? What files?
rizwindu 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.
Lew wrote:
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?

If they are bytecode, then how do you envision they be encoded into a String?
rizwindu wrote:
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.

.



Relevant Pages

  • Re: Java Applet saving results on home server
    ... then how do you envision they be encoded into a String? ... that has some data structures to store all the things I need, ... This puts you right back into your original question. ...
    (comp.lang.java.help)
  • Re: Storing a value for later use in vba or a Macro
    ... Dim strCurrentCustomer as String ... do you programmatically store a value from one record to use in ...
    (microsoft.public.access.gettingstarted)
  • Re: Storing wave files in database
    ... analyse them and store everything in some sort of database. ... You don't store the Wave files in the database. ... ByVal lpOperation As String, _ ... Dim lRet As Long, varTaskID As Variant ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Question about a data structure
    ... I'll store the ... string, it could just be a simgle 150 character string. ... , personally, I'd avoid 'stringing' together responses. ...
    (alt.php)
  • RE: adding data to a file before it gets regexed
    ... The reasion I am trying to add the string to the line, is so that I can use ... it is not a good idea to store entire files in memory and it is really ... the arrays are the contents of the files broken down by lines. ... Any opinion expressed in this e-mail is personal to the sender ...
    (perl.beginners)