Question:
Consider a Java-based application example with file access and file processing methods appropriate?
2007-11-15 20:35:05 UTC
Consider a Java-based application example with file access and file processing methods appropriate for e-business.
Explain why that functionality is valuable for businesses.
Three answers:
siddharthapal
2007-11-15 20:40:10 UTC
// Java example code to create a new file

try

{

File file = new File("path and file_name");

boolean success = file.createNewFile();

}

catch (IOException e) { }



// Java example code to delete a file.

try

{

File file = new File("path and file_name");

boolean success = file.delete();

}

catch (IOException e) { }



// Java example code to read text from a file.

try

{

BufferedReader infile = new BufferedReader(new FileReader("path and file_name "));

String str;

while ((str = in.readLine()) != null)

{

process(str);

}

infile.close();

}

catch (IOException e)

{

// Exceptions ignored.

}



// Java example code to writing to a file.

try

{

BufferedWriter outfile =

new BufferedWriter(new FileWriter("path and file_name "));

outfile.write("a string");

outfile.close();

}

catch (IOException e) { }
edie
2016-05-23 12:52:10 UTC
I don't see a question here. The title has a question mark, but I don't understand what is being asked. Are you asking if there are applications that are written in Java? If so, the answer is - yes there are.
mascix
2007-11-15 20:49:17 UTC
because in e-business there can be a lot of file processes. for example http://www.photrade.com/ they are developing a bussiness which include selling photos to other people you will have to "move" some image files somewhere to another and there must be some image "check" and "resize" or "watermark" functions.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...