jasp.io
Class File

java.lang.Object
  |
  +--jasp.io.File

public class File
extends java.lang.Object

Contains methods and properties that allow you to create, delete, or move a file. Also allows you to query the system for a file name, path, and various other properties


Constructor Summary
File(java.lang.String filename)
           
 
Method Summary
 void Copy(java.lang.String destination)
          Copies a specified file or folder from one location to another.
 void Copy(java.lang.String destination, boolean overwrite)
          Copies a specified file or folder from one location to another.
 void Delete()
          Deletes a specified file
 void Delete(boolean force)
          Deletes a specified file
 boolean exists()
           
 int getAttributes()
           
 vbdate getDateCreated()
           
 vbdate getDateLastAccessed()
           
 vbdate getDateLastModified()
           
 java.lang.String getDrive()
           
 java.lang.String getName()
          Sets or returns the name of a specified file or folder.
 java.lang.String getParentFolder()
           
 java.lang.String getPath()
           
 java.lang.String getShortName()
           
 java.lang.String getShortPath()
           
 int getSize()
           
 java.lang.String getType()
          Returns information about the type of a file or folder.
 void Move(java.lang.String destination)
          Moves a specified file or folder from one location to another.
 TextStream OpenAsTextStream()
          Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.
 TextStream OpenAsTextStream(int iomode)
          Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.
 TextStream OpenAsTextStream(int iomode, int format)
          Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.
 void setAttributes(int attr)
           
 void setName(java.lang.String name1)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

File

public File(java.lang.String filename)
Method Detail

setAttributes

public void setAttributes(int attr)

getAttributes

public int getAttributes()

getDateCreated

public vbdate getDateCreated()

getDateLastAccessed

public vbdate getDateLastAccessed()

getDateLastModified

public vbdate getDateLastModified()

getDrive

public java.lang.String getDrive()
                          throws java.lang.Exception
Returns:
Returns the drive letter of the drive on which the specified file or folder resides. Read-only.

getName

public java.lang.String getName()
Sets or returns the name of a specified file or folder. Read/write.

setName

public void setName(java.lang.String name1)

getParentFolder

public java.lang.String getParentFolder()
                                 throws java.lang.Exception

getPath

public java.lang.String getPath()

getShortName

public java.lang.String getShortName()

getShortPath

public java.lang.String getShortPath()

getSize

public int getSize()

getType

public java.lang.String getType()
Returns information about the type of a file or folder. For example, for files ending in .TXT, "Text Document" is returned.

exists

public boolean exists()

Copy

public void Copy(java.lang.String destination)
          throws java.lang.Exception
Copies a specified file or folder from one location to another.
Parameters:
destination - Destination where the file or folder is to be copied. Wildcard characters are not allowed.

Copy

public void Copy(java.lang.String destination,
                 boolean overwrite)
          throws java.lang.Exception
Copies a specified file or folder from one location to another.
Parameters:
destination - Destination where the file or folder is to be copied. Wildcard characters are not allowed.
overwrite - Boolean value that is True (default) if existing files or folders are to be overwritten; False if they are not.

Delete

public void Delete()
            throws java.lang.Exception
Deletes a specified file

Delete

public void Delete(boolean force)
            throws java.lang.Exception
Deletes a specified file
Parameters:
force - Boolean value that is True if files or folders with the read-only attribute set are to be deleted; False (default) if they are not.

Move

public void Move(java.lang.String destination)
          throws java.lang.Exception
Moves a specified file or folder from one location to another.
Parameters:
destination - Destination where the file or folder is to be moved. Wildcard characters are not allowed.

OpenAsTextStream

public TextStream OpenAsTextStream()
Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.

OpenAsTextStream

public TextStream OpenAsTextStream(int iomode)
Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.
Parameters:
iomode - Indicates input/output mode. Can be one of three constants: ForReading, ForWriting, or ForAppending.

OpenAsTextStream

public TextStream OpenAsTextStream(int iomode,
                                   int format)
Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.
Parameters:
iomode - Indicates input/output mode. Can be one of three constants: ForReading, ForWriting, or ForAppending.
format - One of three Tristate values used to indicate the format of the opened file. If omitted, the file is opened as ASCII.