com.starteam.util
Class FileAccess

java.lang.Object
  extended by com.starteam.util.FileAccess
Direct Known Subclasses:
NativeFileAccess

public abstract class FileAccess
extends java.lang.Object

An interface to obtain certain abstract file properties.


Nested Class Summary
static class FileAccess.Attributes
          Attributes of a working file on disk
 
Constructor Summary
FileAccess()
           
 
Method Summary
 boolean getCanWrite(java.lang.String file)
          Return true if the file is writable by the user.
abstract  long getFileLength(java.lang.String file)
           
abstract  boolean getIsExecutable(java.lang.String file)
          Return true if the file is "executable" by the user.
abstract  long getLastModified(java.lang.String file)
          Return the the file's last modified time.
abstract  boolean isRemoteDrive(java.lang.String file)
           
abstract  void loadFileAttributes(FileAccess.Attributes[] attributes)
          Load all available attributes from the file system in bulk Each attribute object in the array should have the fully qualified file name (with path) specified.
abstract  void setCanWrite(java.lang.String file, boolean value)
          Change whether or not the local file can be modified.
abstract  void setIsExecutable(java.lang.String file, boolean executable)
          Change whether or not the specified file should be marked "executable".
abstract  void setLastModified(java.lang.String file, long time)
          Change the the file's last modified time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileAccess

public FileAccess()
Method Detail

getLastModified

public abstract long getLastModified(java.lang.String file)
                              throws java.io.IOException
Return the the file's last modified time. Value is in milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

Parameters:
file - the specified file
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

setLastModified

public abstract void setLastModified(java.lang.String file,
                                     long time)
                              throws java.io.IOException
Change the the file's last modified time. Value is in milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

Parameters:
file - the specified file
time - the new file time
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

getCanWrite

public boolean getCanWrite(java.lang.String file)
                    throws java.io.IOException
Return true if the file is writable by the user.

Parameters:
file - the specified file
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

setCanWrite

public abstract void setCanWrite(java.lang.String file,
                                 boolean value)
                          throws java.io.IOException
Change whether or not the local file can be modified.

Parameters:
file - the specified file
value - true if the file should be writable and false if not
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

getIsExecutable

public abstract boolean getIsExecutable(java.lang.String file)
                                 throws java.io.IOException
Return true if the file is "executable" by the user. The interpretation of what this means will vary by platform.

Parameters:
file - the specified file
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

setIsExecutable

public abstract void setIsExecutable(java.lang.String file,
                                     boolean executable)
                              throws java.io.IOException
Change whether or not the specified file should be marked "executable".

Parameters:
file - the specified file
executable - true if the file should be marked executable
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

getFileLength

public abstract long getFileLength(java.lang.String file)
                            throws java.io.IOException
Parameters:
file - the specified file
Returns:
The length of the file.
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

isRemoteDrive

public abstract boolean isRemoteDrive(java.lang.String file)
Parameters:
file - the specified file
Returns:
true if the path represented by the file is a remote drive
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.
See Also:
Platform

loadFileAttributes

public abstract void loadFileAttributes(FileAccess.Attributes[] attributes)
Load all available attributes from the file system in bulk Each attribute object in the array should have the fully qualified file name (with path) specified. The returned results will contain the rest of the attributes;

Parameters:
attributes - the attributes to load


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.