com.starteam.util
Class NativeFileAccess

java.lang.Object
  extended by com.starteam.util.FileAccess
      extended by com.starteam.util.NativeFileAccess

public class NativeFileAccess
extends FileAccess

A collection of Native Methods to access the File System directly


Nested Class Summary
 
Nested classes/interfaces inherited from class com.starteam.util.FileAccess
FileAccess.Attributes
 
Constructor Summary
NativeFileAccess()
           
 
Method Summary
 boolean getCanWrite(java.lang.String file)
          Return true if the file is writable by the user.
 long getFileLength(java.lang.String fileName)
           
 boolean getIsExecutable(java.lang.String file)
          Return true if the file is "executable" by the user.
 long getLastModified(java.lang.String file)
          Return the the file's last modified time.
 boolean isRemoteDrive(java.lang.String fileName)
           
 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.
 void setCanWrite(java.lang.String file, boolean value)
          Change whether or not the local file can be modified.
 void setIsExecutable(java.lang.String file, boolean executable)
          Change whether or not the specified file should be marked "executable".
 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

NativeFileAccess

public NativeFileAccess()
Method Detail

getLastModified

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

Specified by:
getLastModified in class FileAccess
Parameters:
file - the specified file
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

setLastModified

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

Specified by:
setLastModified in class FileAccess
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)
Description copied from class: FileAccess
Return true if the file is writable by the user.

Overrides:
getCanWrite in class FileAccess
Parameters:
file - the specified file

setCanWrite

public void setCanWrite(java.lang.String file,
                        boolean value)
                 throws java.io.IOException
Description copied from class: FileAccess
Change whether or not the local file can be modified.

Specified by:
setCanWrite in class FileAccess
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 boolean getIsExecutable(java.lang.String file)
                        throws java.io.IOException
Description copied from class: FileAccess
Return true if the file is "executable" by the user. The interpretation of what this means will vary by platform.

Specified by:
getIsExecutable in class FileAccess
Parameters:
file - the name of the specified file
Returns:
true if the file executable bit is set
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

setIsExecutable

public void setIsExecutable(java.lang.String file,
                            boolean executable)
                     throws java.io.IOException
Description copied from class: FileAccess
Change whether or not the specified file should be marked "executable".

Specified by:
setIsExecutable in class FileAccess
Parameters:
file - the name of the specified file
executable - true to set the file executable bit
Throws:
java.io.IOException - if an I/0 error occurs trying to access the file.

getFileLength

public long getFileLength(java.lang.String fileName)
                   throws java.io.IOException
Specified by:
getFileLength in class FileAccess
Parameters:
fileName - the name of 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 boolean isRemoteDrive(java.lang.String fileName)
Specified by:
isRemoteDrive in class FileAccess
Parameters:
fileName - the fully qualified name of the specified file
Returns:
true if the path represented by the file is a remote drive only supported on Windows platforms
See Also:
Platform

loadFileAttributes

public 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;

Specified by:
loadFileAttributes in class FileAccess
Parameters:
attributes - the attributes to load


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