|
Servertec Foundation Classes 1.3.3 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstec.sfc.Win32.File
public final class File
Used to copy, rename, delete a file or directory, retrieve a file's or directory's short and long path names, get and set a file's or directory's attributes, last modified time, last accessed time and created time.
Constructor Summary | |
---|---|
File(java.lang.String path)
Constructs a new File object. |
Method Summary | |
---|---|
void |
copy(java.lang.String destination_filename,
boolean overwrite)
Used to copy the file to the specified file path. |
void |
delete()
Delete the file. |
boolean |
exists()
Returns whether the file or directory exists. |
int |
getAttributes()
Returns the file's or directory's attributes. |
long |
getCompressedLength()
Returns the compressed file's size in bytes. |
long |
getCreationTime()
Returns the file's or directory's creation time in the number of 100-nanosecond intervals since January 1, 1601. |
long |
getCreationTimeEx()
Returns the file's or directory's creation time in the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. |
long |
getID()
Returns the file's or directory's unique identifier. |
long |
getLastAccessedTime()
Returns the file's or directory's last accessed time in the number of 100-nanosecond intervals since January 1, 1601. |
long |
getLastAccessedTimeEx()
Returns the file's or directory's last accessed time in the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. |
long |
getLastModifiedTime()
Returns the file's or directory's last modified time in the number of 100-nanosecond intervals since January 1, 1601. |
long |
getLastModifiedTimeEx()
Returns the file's or directory's last modified time in the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. |
java.lang.String |
getLongPathName()
Returns the file's or directory's long path name from the MS-DOS short path name. |
java.lang.String |
getShortPathName()
Returns the file's or directory's MS-DOS short path name. |
int |
getType()
Returns the file's or directory's type as defined in FileType. |
int |
getVolumeSerialNumber()
Returns the serial number of the volume that contains the file or directory. |
static long |
java2native(long timestamp)
Returns the native timestamp for the specified Java timestamp. |
long |
length()
Returns the file's size in bytes. |
void |
move(java.lang.String destination_filename,
int move_mode)
Used to move the existing file or directory. |
static long |
native2java(long timestamp)
Returns the Java timestamp for the specified native timestamp. |
void |
rename(java.lang.String destination_filename,
boolean overwrite)
Used to rename the file to the specified file path. |
void |
setAttributes(int attributes)
Used to set the file's or directory's attributes. |
void |
setCreationTime(long timestamp)
Used to set the file's or directory's creation time in the number of 100-nanosecond intervals since January 1, 1601. |
void |
setCreationTimeEx(long timestamp)
Used to set the file's or directory's creation time in the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. |
void |
setLastAccessedTime(long timestamp)
Used to set the file's or directory's last accessed time in the number of 100-nanosecond intervals since January 1, 1601. |
void |
setLastAccessedTimeEx(long timestamp)
Used to set the file's or directory's last accessed time in the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. |
void |
setLastModifiedTime(long timestamp)
Used to set the file's or directory's last modified time in the number of 100-nanosecond intervals since January 1, 1601. |
void |
setLastModifiedTimeEx(long timestamp)
Used to set the file's or directory's last modified time in the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. |
java.lang.String |
toString()
Returns the file's or directory's path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public File(java.lang.String path)
path
- the path to the file or directory.Method Detail |
---|
public final java.lang.String getShortPathName() throws Win32Exception
This method does not expand the file's or directory's path.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final java.lang.String getLongPathName() throws Win32Exception
This method does not expand the file's or directory's path.
Not supported on Windows NT.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final int getAttributes() throws Win32Exception
Win32Exception
- if the file or directory does not exist or if any errors occur.FileAttribute
public final void setAttributes(int attributes) throws Win32Exception
attributes
- the file's or directory's attributes.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final java.lang.String toString()
toString
in class java.lang.Object
public final void delete() throws Win32Exception
Win32Exception
- if the file does not exist or if any errors occur.public final void copy(java.lang.String destination_filename, boolean overwrite) throws Win32Exception
destination_filename
- the path to the new file.overwrite
- whether to overwrite any existing file.
Win32Exception
- if the file does not exist or if the destination file exists and overwrite is false or if any errors occur.public final void rename(java.lang.String destination_filename, boolean overwrite) throws Win32Exception
destination_filename
- the new file path.overwrite
- whether to overwrite any existing file.
Win32Exception
- if the file does not exist or if the destination file exists and overwrite is false or if any errors occur.public final void move(java.lang.String destination_filename, int move_mode) throws Win32Exception
destination_filename
- the new path.move_mode
- specifies how the source will be moved. Defined in FileMoveMode
Win32Exception
- if the file does not exist or if the destination file exists and REPLACE_EXISTING was not specified or if any errors occur.public final boolean exists() throws Win32Exception
Win32Exception
- if any errors occur.public final long getCreationTime() throws Win32Exception
Win32Exception
- if the file or directory does not exist or if any errors occur.public final long getCreationTimeEx() throws Win32Exception
Win32Exception
- if the file or directory does not exist or if any errors occur.public final long getLastModifiedTime() throws Win32Exception
Win32Exception
- if the file or directory does not exist or if any errors occur.public final long getLastModifiedTimeEx() throws Win32Exception
Win32Exception
- if the file or directory does not exist or if any errors occur.public final long getLastAccessedTime() throws Win32Exception
Win32Exception
- if the file or directory does not exist or if any errors occur.public final long getLastAccessedTimeEx() throws Win32Exception
Win32Exception
- if the file or directory does not exist or if any errors occur.public final void setCreationTime(long timestamp) throws Win32Exception
timestamp
- the file's or directory's creation time.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final void setCreationTimeEx(long timestamp) throws Win32Exception
timestamp
- the file's or directory's creation time.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final void setLastModifiedTime(long timestamp) throws Win32Exception
timestamp
- the file's or directory's last modified time.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final void setLastModifiedTimeEx(long timestamp) throws Win32Exception
timestamp
- the file's or directory's last modified time.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final void setLastAccessedTime(long timestamp) throws Win32Exception
timestamp
- the file's or directory's last accessed time.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final void setLastAccessedTimeEx(long timestamp) throws Win32Exception
timestamp
- the file's or directory's last accessed time.
Win32Exception
- if the file or directory does not exist or if any errors occur.public static final long native2java(long timestamp)
timestamp
- the native timestamp.
public static final long java2native(long timestamp)
timestamp
- the Java timestamp.
public final int getType() throws Win32Exception
Win32Exception
- if the file or directory does not exist or if any errors occur.public final long length() throws Win32Exception
Win32Exception
- if the file does not exist, if the file is a directory or if any errors occur.public final long getCompressedLength() throws Win32Exception
Not supported on Windows 9x and Windows Me.
Win32Exception
- if the file does not exist, if the file is a directory or if any errors occur.public final int getVolumeSerialNumber() throws Win32Exception
When combined getVolumeSerialNumber() and getID() provide a unique identifier for the file or directory on this system.
Win32Exception
- if the file or directory does not exist or if any errors occur.public final long getID() throws Win32Exception
When combined getVolumeSerialNumber() and getID() provide a unique identifier for the file or directory on this system.
Win32Exception
- if the file or directory does not exist or if any errors occur.
|
Servertec Foundation Classes 1.3.3 09/04/2005 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2005 Servertec. All rights reserved.