|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.file.AbstractFile
com.mucommander.file.DummyFile
public class DummyFile
This class is an implementation of AbstractFile which implements all methods as no-op (that do nothing)
that return default values. It makes it easy to quickly create a AbstractFile implementation by simply
overridding the methods that are needed, for example as an anonymous class inside a method.
This class should NOT be subclassed for proper AbstractFile implementations. It should only be used in certain circumstances that require creating a quick AbstractFile implementation where only a few methods will be used.
| Field Summary |
|---|
| Fields inherited from class com.mucommander.file.AbstractFile |
|---|
DEFAULT_SEPARATOR, fileURL, IO_BUFFER_SIZE, MUST_HINT, MUST_NOT_HINT, SHOULD_HINT, SHOULD_NOT_HINT, windowsDriveRootPattern |
| Fields inherited from interface com.mucommander.file.PermissionTypes |
|---|
EXECUTE_PERMISSION, READ_PERMISSION, WRITE_PERMISSION |
| Fields inherited from interface com.mucommander.file.PermissionAccesses |
|---|
GROUP_ACCESS, OTHER_ACCESS, USER_ACCESS |
| Constructor Summary | |
|---|---|
DummyFile(FileURL url)
|
|
| Method Summary | |
|---|---|
boolean |
canChangeDate()
Implementation notes: always returns false. |
boolean |
canGetGroup()
Implementation notes: always returns false. |
boolean |
canGetOwner()
Implementation notes: always returns false. |
boolean |
canRunProcess()
Implementation notes: always returns false. |
boolean |
changeDate(long lastModified)
Implementation notes: always returns false. |
boolean |
changePermission(int access,
int permission,
boolean enabled)
Implementation notes: always returns false. |
void |
delete()
Implementation notes: always throws an exception. |
boolean |
exists()
Implementation notes: always returns false. |
PermissionBits |
getChangeablePermissions()
Implementation notes: returns PermissionBits.EMPTY_PERMISSION_BITS, none of the permission bits can be
changed. |
long |
getDate()
Implementation notes: always returns 0. |
long |
getFreeSpace()
Implementation notes: always returns -1. |
java.lang.String |
getGroup()
Implementation notes: always returns null. |
java.io.InputStream |
getInputStream()
Implementation notes: always throws an exception. |
java.io.OutputStream |
getOutputStream(boolean append)
Implementation notes: always throws an exception. |
java.lang.String |
getOwner()
Implementation notes: always returns null. |
AbstractFile |
getParent()
Implementation notes: always returns null. |
FilePermissions |
getPermissions()
Implementation notes: always returns FilePermissions.EMPTY_FILE_PERMISSIONS. |
RandomAccessInputStream |
getRandomAccessInputStream()
Implementation notes: always throws an exception. |
RandomAccessOutputStream |
getRandomAccessOutputStream()
Implementation notes: always throws an exception. |
long |
getSize()
Implementation notes: always returns -1. |
long |
getTotalSpace()
Implementation notes: always returns -1. |
java.lang.Object |
getUnderlyingFileObject()
Implementation notes: always returns null. |
boolean |
hasRandomAccessInputStream()
Implementation notes: always returns false. |
boolean |
hasRandomAccessOutputStream()
Implementation notes: always returns false. |
boolean |
isDirectory()
Implementation notes: always returns false. |
boolean |
isSymlink()
Implementation notes: always returns false. |
AbstractFile[] |
ls()
Implementation notes: always throws an exception. |
void |
mkdir()
Implementation notes: always throws an exception. |
AbstractProcess |
runProcess(java.lang.String[] tokens)
Implementation notes: always throws an exception. |
void |
setParent(AbstractFile parent)
Implementation notes: no-op, does nothing with the specified parent. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DummyFile(FileURL url)
| Method Detail |
|---|
public long getDate()
0.
getDate in class AbstractFilepublic boolean canChangeDate()
false.
canChangeDate in class AbstractFiletrue if this file's date can be changed using AbstractFile.changeDate(long)public boolean changeDate(long lastModified)
false.
changeDate in class AbstractFilelastModified - last modified date, in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)
true if date was changed successfully.public long getSize()
-1.
getSize in class AbstractFile
public AbstractFile getParent()
throws java.io.IOException
null.
getParent in class AbstractFilenull if it doesn't have one
java.io.IOException - if the parent file could not be instanciatedpublic void setParent(AbstractFile parent)
setParent in class AbstractFileparent - the new parent of this filepublic boolean exists()
false.
exists in class AbstractFiletrue if this file existspublic FilePermissions getPermissions()
FilePermissions.EMPTY_FILE_PERMISSIONS.
getPermissions in class AbstractFilepublic PermissionBits getChangeablePermissions()
PermissionBits.EMPTY_PERMISSION_BITS, none of the permission bits can be
changed.
getChangeablePermissions in class AbstractFile
public boolean changePermission(int access,
int permission,
boolean enabled)
false.
changePermission in class AbstractFileaccess - see PermissionTypes for allowed valuespermission - see PermissionAccesses for allowed valuesenabled - true to enable the flag, false to disable it
AbstractFile.getChangeablePermissions()public java.lang.String getOwner()
null.
getOwner in class AbstractFilepublic boolean canGetOwner()
false.
canGetOwner in class AbstractFilepublic java.lang.String getGroup()
null.
getGroup in class AbstractFilepublic boolean canGetGroup()
false.
canGetGroup in class AbstractFilepublic boolean isDirectory()
false.
isDirectory in class AbstractFiletrue if this file is a directory, false in any of the cases listed abovepublic boolean isSymlink()
false.
isSymlink in class AbstractFiletrue if this file is a symbolic link
public AbstractFile[] ls()
throws java.io.IOException
ls in class AbstractFilejava.io.IOException - if this operation is not possible (file is not browsable) or if an error occurred.
public void mkdir()
throws java.io.IOException
mkdir in class AbstractFilejava.io.IOException - if the directory could not be created, either because this file already exists or for any
other reason.
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class AbstractFileInputStream to read the contents of this file
java.io.IOException - in any of the cases listed above
public java.io.OutputStream getOutputStream(boolean append)
throws java.io.IOException
getOutputStream in class AbstractFileappend - if true, data written to the OutputStream will be appended to the end of this file. If false,
any existing data this file contains will be discarded and overwritten.
OuputStream to write the contents of this file
java.io.IOException - in any of the cases listed abovepublic boolean hasRandomAccessInputStream()
false.
hasRandomAccessInputStream in class AbstractFiletrue if the underlying filesystem has support for random access input streams
public RandomAccessInputStream getRandomAccessInputStream()
throws java.io.IOException
getRandomAccessInputStream in class AbstractFileRandomAccessInputStream to read the contents of this file with random access
java.io.IOException - in any of the cases listed abovepublic boolean hasRandomAccessOutputStream()
false.
hasRandomAccessOutputStream in class AbstractFiletrue if the underlying filesystem has support for random access output streams
public RandomAccessOutputStream getRandomAccessOutputStream()
throws java.io.IOException
getRandomAccessOutputStream in class AbstractFileRandomAccessOutputStream to write the contents of this file with random access
java.io.IOException - in any of the cases listed above
public void delete()
throws java.io.IOException
delete in class AbstractFilejava.io.IOException - if this file does not exist or could not be deletedpublic long getFreeSpace()
-1.
getFreeSpace in class AbstractFile-1 if this information is
not available.public long getTotalSpace()
-1.
getTotalSpace in class AbstractFilepublic java.lang.Object getUnderlyingFileObject()
null.
getUnderlyingFileObject in class AbstractFilenull if there
is nonepublic boolean canRunProcess()
false.
canRunProcess in class AbstractFiletrue if it's possible to run processes on the underlying file system, false otherwise.
public AbstractProcess runProcess(java.lang.String[] tokens)
throws java.io.IOException
runProcess in class AbstractFiletokens - command and its arguments for the process to create.
java.io.IOException - thrown if an error occured while creating the process, if the current file is not a directory or if the operation is not supported.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard