public final class VCSFileProxy extends Object implements Comparable<VCSFileProxy>
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite()
Determines whether this file is writable or not.
|
int |
compareTo(VCSFileProxy o) |
static VCSFileProxy |
createFileProxy(File file)
Creates a VCSFileProxy based on io.File.
|
static VCSFileProxy |
createFileProxy(FileObject fileObject)
Creates a VCSFileProxy based on the given
FileObject . |
static VCSFileProxy |
createFileProxy(URI uri) |
static VCSFileProxy |
createFileProxy(VCSFileProxy parent,
String child)
Creates a new VCSFileProxy from the given parent and child name
|
boolean |
equals(Object obj) |
boolean |
exists()
Determines whether this file exists or not.
|
InputStream |
getInputStream(boolean checkLock) |
String |
getName()
Returns the name of this file.
|
VCSFileProxy |
getParentFile()
Returns this files parent or
null if this file doesn't have a parent. |
String |
getPath()
Determines this files path.
|
int |
hashCode() |
boolean |
isDirectory()
Determines whether this file is a directory or not.
|
boolean |
isFile()
Determines whether this file is a normal file or not.
|
long |
lastModified()
Determines the last time this file was modified.
|
VCSFileProxy[] |
listFiles()
Returns an array of files located in a directory given by this file.
|
VCSFileProxy |
normalizeFile()
Normalize a file path to a clean form.
|
File |
toFile()
Returns the corresponding java.io.File in case this instance was created
based either on java.io.File or a
FileObject based on java.io.File. |
FileObject |
toFileObject()
Returns the corresponding FileObject.
|
String |
toString() |
URI |
toURI()
Determines this files URI.
|
public static VCSFileProxy createFileProxy(File file)
file
- the file to be represented by VCSFileProxypublic static VCSFileProxy createFileProxy(VCSFileProxy parent, String child)
parent
- the parent filechild
- the child namepublic static VCSFileProxy createFileProxy(URI uri)
public static VCSFileProxy createFileProxy(FileObject fileObject)
FileObject
. In case there is a
corresponding java.io.File to the FileObject the the io.File will be used as in
VCSFileProxy.createFileProxy(java.io.File)
.fileObject
- the file to be represented by VCSFileProxypublic String getPath()
FileObject.getPath()
or File.getAbsoluteFile()
.File.getPath()
,
FileObject.getPath()
public URI toURI() throws URISyntaxException
FileObject.toURI()
or File.toURI()
.URISyntaxException
File.toURI()
,
FileObject.toURI()
public String getName()
()
public boolean isDirectory()
true
if this file exists and is a directory, otherwise false
File.isDirectory()
public boolean isFile()
true
if this file is a normal file, otherwise false
File.isFile()
public boolean canWrite()
true
if this file is writable, otherwise false
File.canWrite()
public long lastModified()
long
value representing the time the file was
last modified.File.lastModified()
public VCSFileProxy getParentFile()
null
if this file doesn't have a parent.
This method might block for a longer time and shouldn't be called in EDT.File.getParentFile()
public InputStream getInputStream(boolean checkLock) throws FileNotFoundException
FileNotFoundException
public boolean exists()
true
if this files exists, otherwise false
File.exists()
public VCSFileProxy[] listFiles()
null
if this file isn't a directory or an error occurs.File.listFiles()
public File toFile()
FileObject
based on java.io.File.
This method might block for a longer time and shouldn't be called in EDT.null
if none
is available.VCSFileProxy.createFileProxy(java.io.File)
,
VCSFileProxy.createFileProxy(org.openide.filesystems.FileObject)
public FileObject toFileObject()
null
if none availablepublic VCSFileProxy normalizeFile()
FileUtil.normalizePath(java.lang.String)
public int compareTo(VCSFileProxy o)
compareTo
in interface Comparable<VCSFileProxy>