public abstract class FileLocation extends Object
| Constructor and Description |
|---|
FileLocation() |
| Modifier and Type | Method and Description |
|---|---|
static FileLocation |
create(File file)
Creates a
FileLocation instance for the specified local file. |
static FileLocation |
create(String fileFullPath)
Creates a
FileLocation instance for the specified local file. |
static FileLocation |
create(URL url)
Creates a
FileLocation instance for the specified file. |
protected abstract long |
getActualLastModified()
Returns the last time this file was modified, or
TextEditorPane.LAST_MODIFIED_UNKNOWN if this value cannot be
computed (such as for a remote file). |
abstract String |
getFileFullPath()
Returns the full path to the file.
|
abstract String |
getFileName()
Returns the name of the file.
|
protected abstract InputStream |
getInputStream()
Opens an input stream for reading from this file.
|
protected abstract OutputStream |
getOutputStream()
Opens an output stream for writing this file.
|
abstract boolean |
isLocal()
Returns whether this file location is a local file.
|
abstract boolean |
isLocalAndExists()
Returns whether this file location is a local file that already
exists.
|
boolean |
isRemote()
Returns whether this file location is a remote location.
|
public static FileLocation create(String fileFullPath)
FileLocation instance for the specified local file.fileFullPath - The full path to a local file.public static FileLocation create(File file)
FileLocation instance for the specified local file.file - A local file.public static FileLocation create(URL url)
FileLocation instance for the specified file.url - The URL of a file.protected abstract long getActualLastModified()
TextEditorPane.LAST_MODIFIED_UNKNOWN if this value cannot be
computed (such as for a remote file).public abstract String getFileFullPath()
getFileName()public abstract String getFileName()
getFileFullPath()protected abstract InputStream getInputStream() throws IOException
IOException - If the file does not exist, or some other IO error
occurs.protected abstract OutputStream getOutputStream() throws IOException
IOException - If an IO error occurs.public abstract boolean isLocal()
isLocalAndExists()public abstract boolean isLocalAndExists()
isLocal()public boolean isRemote()
Copyright © 2009-2013 jtstand.com. All Rights Reserved.