Package org.fife.ui.rsyntaxtextarea
Class FileLocation
java.lang.Object
org.fife.ui.rsyntaxtextarea.FileLocation
- Direct Known Subclasses:
FileFileLocation
,URLFileLocation
Holds the location of a local or remote file. This provides a common way
to read, write, and check properties of both local and remote files.
- Version:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FileLocation
Creates aFileLocation
instance for the specified local file.static FileLocation
Creates aFileLocation
instance for the specified local file.static FileLocation
Creates aFileLocation
instance for the specified file.protected abstract long
Returns the last time this file was modified, orTextEditorPane.LAST_MODIFIED_UNKNOWN
if this value cannot be computed (such as for a remote file).abstract String
Returns the full path to the file.abstract String
Returns the name of the file.protected abstract InputStream
Opens an input stream for reading from this file.protected abstract OutputStream
Opens an output stream for writing this file.abstract boolean
isLocal()
Returns whether this file location is a local file.abstract boolean
Returns whether this file location is a local file that already exists.boolean
isRemote()
Returns whether this file location is a remote location.
-
Constructor Details
-
FileLocation
public FileLocation()
-
-
Method Details
-
create
Creates aFileLocation
instance for the specified local file.- Parameters:
fileFullPath
- The full path to a local file.- Returns:
- The file's location.
-
create
Creates aFileLocation
instance for the specified local file.- Parameters:
file
- A local file.- Returns:
- The file's location.
-
create
Creates aFileLocation
instance for the specified file.- Parameters:
url
- The URL of a file.- Returns:
- The file's location.
-
getActualLastModified
protected abstract long getActualLastModified()Returns the last time this file was modified, orTextEditorPane.LAST_MODIFIED_UNKNOWN
if this value cannot be computed (such as for a remote file).- Returns:
- The last time this file was modified.
-
getFileFullPath
Returns the full path to the file. This will be stripped of sensitive information such as passwords for remote files.- Returns:
- The full path to the file.
- See Also:
-
getFileName
Returns the name of the file.- Returns:
- The name of the file.
- See Also:
-
getInputStream
Opens an input stream for reading from this file.- Returns:
- The input stream.
- Throws:
IOException
- If the file does not exist, or some other IO error occurs.
-
getOutputStream
Opens an output stream for writing this file.- Returns:
- An output stream.
- Throws:
IOException
- If an IO error occurs.
-
isLocal
public abstract boolean isLocal()Returns whether this file location is a local file.- Returns:
- Whether this is a local file.
- See Also:
-
isLocalAndExists
public abstract boolean isLocalAndExists()Returns whether this file location is a local file that already exists.- Returns:
- Whether this file is local and actually exists.
- See Also:
-
isRemote
public boolean isRemote()Returns whether this file location is a remote location.- Returns:
- Whether this is a remote file location.
-