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.File
File 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.boolean
exists()
Check if the file exists.java.lang.String
getAbsolutePath()
Get the path.java.io.File
getCanonicalFile()
Get the canonical name.java.lang.String
getCanonicalPath()
FileData
getFiledata()
Get the filedata.java.lang.String
getName()
Get the file name.java.lang.String
getParent()
Get the parent name.java.io.File
getParentFile()
Get the parent file.java.lang.String
getPath()
Get the path.boolean
isAbsolute()
Test if absolute.boolean
isDirectory()
Test if is a directory.boolean
isFile()
Test if is a file.boolean
isHidden()
Test if file is hidden.long
lastModified()
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 void
main(java.lang.String[] args)
Main for testing.java.lang.String
toString()
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:
isDirectory
in classjava.io.File
- Returns:
- True, if directory.
-
listFiles
public java.io.File[] listFiles(java.io.FileFilter filter)
- Overrides:
listFiles
in classjava.io.File
-
listFiles
public java.io.File[] listFiles(java.io.FilenameFilter filter)
- Overrides:
listFiles
in classjava.io.File
-
listFiles
public java.io.File[] listFiles()
- Overrides:
listFiles
in classjava.io.File
-
lastModified
public long lastModified()
Get the last modified date.- Overrides:
lastModified
in classjava.io.File
-
exists
public boolean exists()
Check if the file exists.- Overrides:
exists
in classjava.io.File
-
getName
public java.lang.String getName()
Get the file name.- Overrides:
getName
in classjava.io.File
- Returns:
- The file name.
-
getAbsolutePath
public java.lang.String getAbsolutePath()
Get the path.- Overrides:
getAbsolutePath
in classjava.io.File
-
getPath
public java.lang.String getPath()
Get the path.- Overrides:
getPath
in classjava.io.File
-
getParent
public java.lang.String getParent()
Get the parent name.- Overrides:
getParent
in classjava.io.File
- Returns:
- The parent name.
-
getParentFile
public java.io.File getParentFile()
Get the parent file.- Overrides:
getParentFile
in classjava.io.File
-
isAbsolute
public boolean isAbsolute()
Test if absolute.- Overrides:
isAbsolute
in classjava.io.File
- Returns:
- Treu, if absolute.
-
getCanonicalPath
public java.lang.String getCanonicalPath() throws java.io.IOException
- Overrides:
getCanonicalPath
in classjava.io.File
- Throws:
java.io.IOException
-
getCanonicalFile
public java.io.File getCanonicalFile() throws java.io.IOException
Get 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:
getCanonicalFile
in classjava.io.File
- Throws:
java.io.IOException
-
isFile
public boolean isFile()
Test if is a file.- Overrides:
isFile
in classjava.io.File
- Returns:
- True, if is a file.
-
isHidden
public boolean isHidden()
Test if file is hidden.- Overrides:
isHidden
in classjava.io.File
- Returns:
- True, if hidden.
-
list
public java.lang.String[] list()
List contained filed. JFileChooser uses the FileSystemView.- Overrides:
list
in classjava.io.File
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in 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.Exception
Main for testing.- Throws:
java.lang.Exception
-
-