Package jadex.base.gui.filechooser
Class RemoteFile
- java.lang.Object
-
- java.io.File
-
- jadex.base.gui.filechooser.RemoteFile
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<java.io.File>
public class RemoteFile extends java.io.FileFile wrapper for remote files. Is necessary because JFileChooser works with File objects only.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RemoteFile(FileData filedata)Create a directory representation of a jar file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RemoteFile[]convertToFiles(FileData[] remfiles)Convert remote files to files.booleanexists()Check if the file exists.java.lang.StringgetAbsolutePath()Get the path.java.io.FilegetCanonicalFile()Get the canonical name.java.lang.StringgetCanonicalPath()FileDatagetFiledata()Get the filedata.java.lang.StringgetName()Get the file name.java.lang.StringgetParent()Get the parent name.java.io.FilegetParentFile()Get the parent file.java.lang.StringgetPath()Get the path.booleanisAbsolute()Test if absolute.booleanisDirectory()Test if is a directory.booleanisFile()Test if is a file.booleanisHidden()Test if file is hidden.longlastModified()Get the last modified date.java.lang.String[]list()List contained filed.java.io.File[]listFiles()java.io.File[]listFiles(java.io.FileFilter filter)java.io.File[]listFiles(java.io.FilenameFilter filter)static voidmain(java.lang.String[] args)Main for testing.java.lang.StringtoString()Get the string representation.-
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, getAbsoluteFile, getFreeSpace, getTotalSpace, getUsableSpace, hashCode, length, list, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toURI, toURL
-
-
-
-
Field Detail
-
filedata
protected FileData filedata
The file data.
-
-
Constructor Detail
-
RemoteFile
public RemoteFile(FileData filedata)
Create a directory representation of a jar file.
-
-
Method Detail
-
getFiledata
public FileData getFiledata()
Get the filedata.- Returns:
- the filedata.
-
isDirectory
public boolean isDirectory()
Test if is a directory.- Overrides:
isDirectoryin classjava.io.File- Returns:
- True, if directory.
-
listFiles
public java.io.File[] listFiles(java.io.FileFilter filter)
- Overrides:
listFilesin classjava.io.File
-
listFiles
public java.io.File[] listFiles(java.io.FilenameFilter filter)
- Overrides:
listFilesin classjava.io.File
-
listFiles
public java.io.File[] listFiles()
- Overrides:
listFilesin classjava.io.File
-
lastModified
public long lastModified()
Get the last modified date.- Overrides:
lastModifiedin classjava.io.File
-
exists
public boolean exists()
Check if the file exists.- Overrides:
existsin classjava.io.File
-
getName
public java.lang.String getName()
Get the file name.- Overrides:
getNamein classjava.io.File- Returns:
- The file name.
-
getAbsolutePath
public java.lang.String getAbsolutePath()
Get the path.- Overrides:
getAbsolutePathin classjava.io.File
-
getPath
public java.lang.String getPath()
Get the path.- Overrides:
getPathin classjava.io.File
-
getParent
public java.lang.String getParent()
Get the parent name.- Overrides:
getParentin classjava.io.File- Returns:
- The parent name.
-
getParentFile
public java.io.File getParentFile()
Get the parent file.- Overrides:
getParentFilein classjava.io.File
-
isAbsolute
public boolean isAbsolute()
Test if absolute.- Overrides:
isAbsolutein classjava.io.File- Returns:
- Treu, if absolute.
-
getCanonicalPath
public java.lang.String getCanonicalPath() throws java.io.IOException- Overrides:
getCanonicalPathin classjava.io.File- Throws:
java.io.IOException
-
getCanonicalFile
public java.io.File getCanonicalFile() throws java.io.IOExceptionGet the canonical name. Needs to return this because JFileCooser uses this method to check isTraverable(), i.e. if a dir can be looked into. Hence, the dir property must be kept in returned file.- Overrides:
getCanonicalFilein classjava.io.File- Throws:
java.io.IOException
-
isFile
public boolean isFile()
Test if is a file.- Overrides:
isFilein classjava.io.File- Returns:
- True, if is a file.
-
isHidden
public boolean isHidden()
Test if file is hidden.- Overrides:
isHiddenin classjava.io.File- Returns:
- True, if hidden.
-
list
public java.lang.String[] list()
List contained filed. JFileChooser uses the FileSystemView.- Overrides:
listin classjava.io.File
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toStringin classjava.io.File- Returns:
- The string representation.
-
convertToFiles
public static RemoteFile[] convertToFiles(FileData[] remfiles)
Convert remote files to files.
-
main
public static void main(java.lang.String[] args) throws java.lang.ExceptionMain for testing.- Throws:
java.lang.Exception
-
-