S-PLUS Connect/Java v1.0

com.insightful.splus.util
Class FileUtilities

java.lang.Object
  extended by com.insightful.splus.util.FileUtilities

public class FileUtilities
extends Object

Class providing useful file query static methods. If not in client/server mode, standard java.io.File methods are used. If in client/server mode, operations are wil respect to the server files system and S-PLUS engine queries are used.


Method Summary
static boolean confirmSaveAs(Component parentComponent, String fileName)
          Static method used by Save As dialogs to test whether to proceed with a file save.
static void transferBytes(FileInputStream sourceStream, FileOutputStream targetStream)
          Transfer a file from a FileInputStream to a FileOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

confirmSaveAs

public static boolean confirmSaveAs(Component parentComponent,
                                    String fileName)
Static method used by Save As dialogs to test whether to proceed with a file save. If the file exists and is non-writable an error dialog is displayed and false returned. If the file exists and is writable, a dialog prompts the user on whether to overwrite, and the response is returned. If the file does not exist, true is returned.


transferBytes

public static void transferBytes(FileInputStream sourceStream,
                                 FileOutputStream targetStream)
                          throws IOException
Transfer a file from a FileInputStream to a FileOutputStream. This is a straight transfer of the bytes. It reads from the input stream as long as there is more to read, and writes the bytes to the output stream. This method does not open or close the file streams, it just performs the byte transfer.

Throws:
IOException

S-PLUS Connect/Java v1.0

Copyright © 2000, 2002 Insightful Corporation
Warning: Classes not documented in the S-PLUS Programmer's Guide may change in future releases.