public class IFSJavaFile
extends java.io.File
implements java.io.Serializable
When should IFSJavaFile be used?
IFSFile
is more useful. IFSFile is written to
handle more of the specific IBM i integrated file system details.
Notes:
IFSFileInputStream
and
IFSFileOutputStream
.
It does not support java.io.FileInputStream
and java.io.FileOutputStream.
The following example demonstrates the use of IFSJavaFile. It shows how a few lines of platform specific code enable the creation of a file on either the IBM i system or the local client.
int location = ON_THE_SERVER; // on the IBM i system java.io.File file = null; java.io.OutputStream os = null;
if (location == ON_THE_SERVER) file = new IFSJavaFile(new AS400("enterprise"), path); // Work with the file on the system "enterprise". else file = new java.io.File(path); // Work with the file on the local file system.
if (file.exists()) System.out.println("Length: " + file.length()); // Determine the file size. else System.out.println("File " + file.getName() + " not found");
// Delete the file. This should be done before creating an output stream. if (file.delete() == false) System.err.println("Unable to delete file."); // Display the error message.
if (location == ON_THE_SERVER) os = (OutputStream)new IFSFileOutputStream((IFSJavaFile)file); else os = new FileOutputStream(file);
writeData(file, os); os.close();
void writeData(java.io.File file, java.io.OutputStream os) throws IOException { // Determine the parent directory of the file. System.out.println("Directory: " + file.getParent());
// Determine the name of the file. System.out.println("Name: " + file.getName());
// Determine when the file was last modified. System.out.println("Date: " + new Date(file.lastModified()));
System.out.println("Writing Data"); for (int i = 0; i < 256; i++) os.write((byte)i); }
IFSFile
,
IFSFileInputStream
,
IFSFileOutputStream
,
Serialized FormConstructor and Description |
---|
IFSJavaFile()
Creates a default IFSJavaFile instance.
|
IFSJavaFile(AS400 system,
IFSJavaFile directory,
java.lang.String name)
Creates a new IFSJavaFile instance for the specified system, from a parent abstract pathname and a child pathname string.
|
IFSJavaFile(AS400 system,
java.lang.String path)
Creates a new IFSJavaFile instance for the specified system, using a file pathname string.
|
IFSJavaFile(AS400 system,
java.lang.String path,
java.lang.String name)
Creates a new IFSJavaFile instance for the specified system, from a parent pathname string and a child pathname string.
|
IFSJavaFile(IFSFile file)
Creates a new IFSJavaFile instance from an IFSFile object.
|
IFSJavaFile(IFSJavaFile directory,
java.lang.String name)
Creates a new IFSJavaFile instance from a parent abstract pathname and a child pathname string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExecute()
Tests whether the application can execute the file denoted by this abstract pathname.
|
boolean |
canRead()
Indicates if the program can read from the file denoted by this abstract pathname.
|
boolean |
canWrite()
Indicates if the program can write to the file denoted by this abstract pathname.
|
int |
compareTo(java.io.File file)
Compares the path of IFSJavaFile with a
File 's path. |
int |
compareTo(IFSFile file)
Compares the path of IFSJavaFile with a
IFSFile 's path. |
int |
compareTo(IFSJavaFile file)
Compares the paths of two IFSJavaFiles.
|
boolean |
createNewFile()
Atomically create a new, empty file.
|
boolean |
delete()
Deletes the IFSJavaFile.
|
boolean |
equals(java.lang.Object obj)
Compares this IFSJavaFile against the specified object.
|
boolean |
exists()
Indicates if the IFSJavaFile exists.
|
java.io.File |
getAbsoluteFile()
Returns An IFSJavaFile object based on the absolute path name of the
current object.
|
java.lang.String |
getAbsolutePath()
Returns the absolute path name of the IFSJavaFile.
|
java.io.File |
getCanonicalFile()
Returns An IFSJavaFile object based on the canonical path name of the
current object.
|
java.lang.String |
getCanonicalPath()
Returns the path name in canonical form of IFSJavaFile path.
|
long |
getFreeSpace()
Returns the number of unallocated bytes in the partition named by this abstract path name.
|
java.lang.String |
getName()
Returns the name of the IFSJavaFile.
|
java.lang.String |
getParent()
Returns the parent directory of the IFSJavaFile.
|
java.io.File |
getParentFile()
Returns an IFSJavaFile object that represents the parent of
the current object.
|
java.lang.String |
getPath()
Returns the path name of the IFSJavaFile.
|
int |
getPatternMatching()
Returns the pattern-matching behavior used when files are listed by any of the list() or listFiles() methods.
|
AS400 |
getSystem()
Returns the system that this object references.
|
long |
getTotalSpace()
Returns the size of the partition named by this abstract pathname.
|
long |
getUsableSpace()
Returns the number of bytes available to this virtual machine on the partition named by this abstract pathname.
|
int |
hashCode()
Computes a hashcode for this object.
|
boolean |
isAbsolute()
Indicates if the path name of this IFSJavaFile is an
absolute path name.
|
boolean |
isDirectory()
Indicates if the IFSJavaFile is a directory.
|
boolean |
isFile()
Indicates if the IFSJavaFile is a "normal" file.
|
boolean |
isHidden()
Indicates if the IFSJavaFile is hidden.
|
long |
lastModified()
Indicates the time that the IFSJavaFile was last modified.
|
long |
length()
Indicates the length of this IFSJavaFile.
|
java.lang.String[] |
list()
Lists the files in this IFSJavaFile directory.
|
java.lang.String[] |
list(java.io.FilenameFilter filter)
Lists the files in this IFSJavaFile directory that satisfy filter.
|
java.lang.String[] |
list(IFSFileFilter filter)
Lists the files in the IFSJavaFile directory that satisfy file name filter.
|
java.lang.String[] |
list(IFSFileFilter filter,
java.lang.String pattern)
Lists the files in this IFSJavaFile directory that satisfy filter and pattern.
|
java.lang.String[] |
list(java.lang.String pattern)
Lists the files in this IFSJavaFile directory that match pattern.
|
java.io.File[] |
listFiles()
Lists the files in this IFSJavaFile directory.
|
java.io.File[] |
listFiles(java.io.FileFilter filter)
Lists the files in this IFSJavaFile directory that satisfy filter.
|
java.io.File[] |
listFiles(java.io.FilenameFilter filter)
Lists the files in this IFSJavaFile directory that satisfy filter.
|
java.io.File[] |
listFiles(IFSFileFilter filter)
Lists the files in the IFSJavaFile directory that satisfy file name filter.
|
java.io.File[] |
listFiles(IFSFileFilter filter,
java.lang.String pattern)
Lists the files in this IFSJavaFile directory that satisfy filter and
pattern.
|
java.io.File[] |
listFiles(java.lang.String pattern)
Lists the files in this IFSJavaFile directory that match pattern.
|
static java.io.File[] |
listRoots()
Lists the file system roots for the integrated file system
of the IBM i system.
|
boolean |
mkdir()
Creates a directory whose path name
is specified by this IFSJavaFile.
|
boolean |
mkdirs()
Creates a directory whose path name is
specified by this IFSJavaFile, including any necessary
parent directories.
|
boolean |
renameTo(java.io.File dest)
Renames the IFSJavaFile to have the path name of dest.
|
boolean |
renameTo(IFSJavaFile dest)
Renames the IFSJavaFile to have the path name of dest.
|
boolean |
setExecutable(boolean executable)
A convenience method to set the owner's execute permission for this abstract pathname.
|
boolean |
setExecutable(boolean executable,
boolean ownerOnly)
Sets the owner's or everybody's execute permission for this abstract pathname.
|
boolean |
setLastModified(long time)
Sets the last modified time of the file named by this
IFSJavaFile object.
|
boolean |
setLength(int length)
Sets the length of the file named by this
IFSJavaFile object.
|
boolean |
setPath(java.lang.String path)
Sets the path for this IFSJavaFile.
|
void |
setPatternMatching(int patternMatching)
Sets the pattern-matching behavior used when files are listed by any of the list() or listFiles() methods.
|
boolean |
setReadable(boolean readable)
A convenience method to set the owner's read permission for this abstract pathname.
|
boolean |
setReadable(boolean readable,
boolean ownerOnly)
Sets the owner's or everybody's read permission for this abstract pathname.
|
boolean |
setReadOnly()
Marks the file named by this IFSJavaFile object so that only
read operations are allowed.
|
boolean |
setSystem(AS400 system)
Sets the system.
|
boolean |
setWritable(boolean writable)
A convenience method to set the owner's write permission for this abstract pathname.
|
boolean |
setWritable(boolean writable,
boolean ownerOnly)
Sets the owner's or everybody's write permission for this abstract pathname.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
java.net.URL |
toURL()
Converts the abstract path name into a
file: URL. |
public IFSJavaFile()
public IFSJavaFile(AS400 system, java.lang.String path)
system
- The system that contains the IFSJavaFile.path
- The file path name where the IFSJavaFile is or will be stored.public IFSJavaFile(AS400 system, java.lang.String path, java.lang.String name)
system
- The system that contains the IFSJavaFile.path
- The file path name where the IFSJavaFile is or will be stored.name
- The name of the IFSJavaFile object.public IFSJavaFile(IFSJavaFile directory, java.lang.String name)
The directory argument cannot be null. The constructed IFSJavaFile instance uses the following settings taken from directory:
directory
- The directory where the IFSJavaFile is or will be stored.name
- The name of the IFSJavaFile object.public IFSJavaFile(AS400 system, IFSJavaFile directory, java.lang.String name)
system
- The system that contains the IFSJavaFile.directory
- The directory where the IFSJavaFile is or will be stored.name
- The name of the IFSJavaFile object.public IFSJavaFile(IFSFile file)
file
- An IFSFile object.public boolean canExecute() throws java.lang.SecurityException
canExecute
in class java.io.File
java.lang.SecurityException
- If an unanticipated security error occurs.public boolean canRead() throws java.lang.SecurityException
canRead
in class java.io.File
java.lang.SecurityException
- If an unanticipated security error occurs.public boolean canWrite() throws java.lang.SecurityException
canWrite
in class java.io.File
java.lang.SecurityException
- If an unanticipated security error occurs.public int compareTo(IFSJavaFile file)
The following examples demonstrate the use of this method:
In this example, returnCode would be less than 0
because the
path of file
is less than the path of file2
.
IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path); IFSJavaFile file2 = new IFSJavaFile(new AS400("enterprise"), path + "\\extra");
int returnCode = file.compareTo(file2);
In this example, returnCode would be greater than 0
because the
path of file
is greater than the path of file2
.
IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path + "\\extra"); IFSJavaFile file2 = new IFSJavaFile(new AS400("enterprise"), path);
int returnCode = file.compareTo(file2);
In this example, returnCode would be less than 0
because the
path of file
is less than the path of file2
.
IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), "\\QSYS.LIB\\herlib"); IFSJavaFile file2 = new IFSJavaFile(new AS400("enterprise"), "\\QSYS.LIB\\hislib");
int returnCode = file.compareTo(file2);
Note:
The comparison is case sensitive.
file
- The IFSJavaFile to be compared.0
if this IFSJavaFile path equals file
's path;
a value less than 0
if this IFSJavaFile path is less than the file
's
path; and a value greater than 0
if this IFSJavaFile path is greater
than the file's
path.public int compareTo(java.io.File file)
File
's path.
Note:
The comparison is case sensitive.
compareTo
in interface java.lang.Comparable<java.io.File>
compareTo
in class java.io.File
file
- The File
to be compared.0
if this IFSJavaFile path equals the argument's path;
a value less than 0
if this IFSJavaFile path is less than the argument's
path; and a value greater than 0
if this IFSJavaFile path is greater
than the argument's path.public int compareTo(IFSFile file)
IFSFile
's path.
Note:
The comparison is case sensitive.
file
- The IFSFile
to be compared.0
if this IFSJavaFile path equals the argument's path;
a value less than 0
if this IFSJavaFile path is less than the argument's
path; and a value greater than 0
if this IFSJavaFile path is greater
than the argument's path.public boolean createNewFile() throws java.io.IOException
createNewFile
in class java.io.File
java.io.IOException
- If an I/O error occurs while communicating with the IBM i system.public boolean delete() throws java.lang.SecurityException
delete
in class java.io.File
true
if the file is successfully deleted;
false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean equals(java.lang.Object obj)
true
if and only if the argument is
not null and is an IFSJavaFile
object whose path name is equal to the path name of
this IFSJavaFile,
and system names of the objects are equal.equals
in class java.io.File
obj
- The object to compare with.true
if the objects are the same;
false
otherwise.public boolean exists() throws java.lang.SecurityException
exists
in class java.io.File
true
if the file specified by this object
exists; false
otherwise.java.lang.SecurityException
- If the user is denied read access to the file.java.lang.SecurityException
- If the user is denied access to the file.public java.io.File getAbsoluteFile()
getAbsoluteFile
in class java.io.File
getAbsolutePath()
public java.lang.String getAbsolutePath()
getAbsolutePath
in class java.io.File
isAbsolute()
public java.io.File getCanonicalFile() throws java.io.IOException
getCanonicalFile
in class java.io.File
java.io.IOException
- If an I/O error occurs while communicating with the IBM i system.getCanonicalPath()
public java.lang.String getCanonicalPath() throws java.io.IOException
getCanonicalPath
in class java.io.File
java.io.IOException
- If an I/O error occurs while communicating with the IBM i system.public long getFreeSpace() throws java.lang.SecurityException
The returned number of unallocated bytes is a hint, but not a guarantee, that it is possible to use most or any of these bytes. The number of unallocated bytes is most likely to be accurate immediately after this call. It is likely to be made inaccurate by any external I/O operations including those made on the system outside of this virtual machine. This method makes no guarantee that write operations to this file system will succeed.
getFreeSpace
in class java.io.File
java.lang.SecurityException
- If the user is denied access to the file.public long getTotalSpace() throws java.lang.SecurityException
getTotalSpace
in class java.io.File
java.lang.SecurityException
- If the user is denied access to the file.public long getUsableSpace() throws java.lang.SecurityException
The returned number of available bytes is a hint, but not a guarantee, that it is possible to use most or any of these bytes. The number of unallocated bytes is most likely to be accurate immediately after this call. It is likely to be made inaccurate by any external I/O operations including those made on the system outside of this virtual machine. This method makes no guarantee that write operations to this file system will succeed.
Note: If the user profile has a "maximum storage allowed" setting of *NOMAX, then getUsableSpace() returns the same value as getFreeSpace()
.
getUsableSpace
in class java.io.File
java.lang.SecurityException
- If the user is denied access to the file.public java.lang.String getName()
The following example demonstrates the use of this method:
In this example, fileName would equal "file.dat".
String path = "\\path\\file.dat"; IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path);
String fileName = file.getName();
getName
in class java.io.File
public java.lang.String getParent()
The following example demonstrates the use of this method:
In this example, parentPath would equal "\test".
String path = "\\test\\path"; IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path);
String parentPath = file.getParent();
getParent
in class java.io.File
getParentFile()
public java.io.File getParentFile()
getParentFile
in class java.io.File
getParent()
public java.lang.String getPath()
The following example demonstrates the use of this method:
In this example, thePath would equal "\test\path" the same value as path.
String path = "\\test\\path"; IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path);
String thePath = file.getPath();
getPath
in class java.io.File
public int getPatternMatching() throws java.io.IOException
PATTERN_POSIX
, PATTERN_POSIX_ALL
, or PATTERN_OS2
java.io.IOException
- If an error occurs while communicating with the system.public AS400 getSystem()
public int hashCode()
hashCode
in class java.io.File
public boolean isAbsolute()
isAbsolute
in class java.io.File
true
if the path name specification is absolute; false
otherwise.public boolean isDirectory() throws java.lang.SecurityException
isDirectory
in class java.io.File
true
if the IFSJavaFile exists and is a directory; false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean isFile() throws java.lang.SecurityException
isFile
in class java.io.File
true
if the specified file exists and is a "normal" file; false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean isHidden() throws java.lang.SecurityException
isHidden
in class java.io.File
true
if the file is hidden; false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public long lastModified() throws java.lang.SecurityException
lastModified
in class java.io.File
0
if it does not exist.java.lang.SecurityException
- If the user is denied access to the file.public long length() throws java.lang.SecurityException
length
in class java.io.File
0
((IFSJavaFile) if it does not exist.java.lang.SecurityException
- If the user is denied access to the file.public java.lang.String[] list() throws java.lang.SecurityException
list
in class java.io.File
java.lang.SecurityException
- If the user is denied access to the file.listFiles()
public java.lang.String[] list(java.io.FilenameFilter filter) throws java.lang.SecurityException
list
in class java.io.File
filter
- The file name filter.The following example demonstrates the use of this method:
class AcceptClass implements java.io.FilenameFilter { public boolean accept(java.io.File dir, java.lang.String name) { if (name.startsWith("IFS")) return true; return false; } }
IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path); AcceptClass ac = new AcceptClass(); file.list(ac);
java.lang.SecurityException
- If the user is denied access to the file.listFiles(FilenameFilter)
public java.lang.String[] list(IFSFileFilter filter) throws java.lang.SecurityException
filter
- The file name filter.The following example demonstrates the use of this method:
class AcceptClass implements IFSFileFilter { public boolean accept(IFSFile file) { if (file.getName().startsWith("IFS")) return true; return false; } }
IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path); AcceptClass ac = new AcceptClass(); file.list(ac);
java.lang.SecurityException
- If the user is denied access to the file.listFiles(IFSFileFilter)
public java.lang.String[] list(IFSFileFilter filter, java.lang.String pattern) throws java.lang.SecurityException
Note:
If the file does not match pattern, it will not be processed by filter.
filter
- The file name filter.pattern
- The pattern that all filenames must match. Acceptable characters are
wildcards (* - matches multiple characters) and question marks (? - matches
one character). Pattern must not be null.java.lang.SecurityException
- If the user is denied access to the file.listFiles(IFSFileFilter,String)
public java.lang.String[] list(java.lang.String pattern) throws java.lang.SecurityException
pattern
- The pattern that all filenames must match.
Acceptable characters are wildcards (* - matches
multiple characters) and question marks (? - matches
one character).java.lang.SecurityException
- If the user is denied access to the file.listFiles(String)
public java.io.File[] listFiles() throws java.lang.SecurityException
listFiles
in class java.io.File
java.lang.SecurityException
- If the user is denied access to the file.list()
public java.io.File[] listFiles(java.io.FilenameFilter filter) throws java.lang.SecurityException
listFiles
in class java.io.File
filter
- The file name filter.The following example demonstrates the use of this method:
class AcceptClass implements java.io.FilenameFilter { public boolean accept(java.io.File dir, java.lang.String name) { if (name.startsWith("IFS")) return true; return false; } }
IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path); AcceptClass ac = new AcceptClass(); file.listFiles(ac);
java.lang.SecurityException
- If the user is denied access to the file.list(FilenameFilter)
public java.io.File[] listFiles(java.io.FileFilter filter) throws java.lang.SecurityException
listFiles
in class java.io.File
filter
- The file filter.The following example demonstrates the use of this method:
class AcceptClass implements java.io.FileFilter { public boolean accept(java.io.File file) { if (file.getName().startsWith("IFS")) return true; return false; } }
IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path); AcceptClass ac = new AcceptClass(); file.listFiles(ac);
java.lang.SecurityException
- If the user is denied access to the file.public java.io.File[] listFiles(IFSFileFilter filter) throws java.lang.SecurityException
filter
- The file name filter.The following example demonstrates the use of this method:
class AcceptClass implements IFSFileFilter { public boolean accept(IFSFile file) { if (file.getName().startsWith("IFS")) return true; return false; } }
IFSJavaFile file = new IFSJavaFile(new AS400("enterprise"), path); AcceptClass ac = new AcceptClass(); file.listFiles(ac);
java.lang.SecurityException
- If the user is denied access to the file.list(IFSFileFilter)
public java.io.File[] listFiles(IFSFileFilter filter, java.lang.String pattern) throws java.lang.SecurityException
Note:
If the file does not match pattern, it will not be processed by filter.
filter
- The file name filter.pattern
- The pattern that all filenames must match. Acceptable characters are
wildcards (* - matches multiple characters) and question marks (? - matches
one character). Pattern must not be null.java.lang.SecurityException
- If the user is denied access to the file.list(IFSFileFilter,String)
public java.io.File[] listFiles(java.lang.String pattern) throws java.lang.SecurityException
pattern
- The pattern that all filenames must match.
Acceptable characters are wildcards (* - matches
multiple characters) and question marks (? - matches
one character).java.lang.SecurityException
- If the user is denied access to the file.list(String)
public static java.io.File[] listRoots()
public boolean mkdir() throws java.lang.SecurityException
mkdir
in class java.io.File
true
if the directory could be created;
false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean mkdirs() throws java.lang.SecurityException
mkdirs
in class java.io.File
true
if the directory (or directories) could be
created; false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean renameTo(IFSJavaFile dest) throws java.lang.SecurityException
dest
- The new filename.true
if the renaming succeeds;
false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean renameTo(java.io.File dest) throws java.lang.SecurityException
renameTo
in class java.io.File
dest
- An object specifying the new filename.
If this object is not an IFSJavaFile, the rename will fail.true
if the renaming succeeds;
false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean setLastModified(long time) throws java.lang.SecurityException
setLastModified
in class java.io.File
time
- The new last modified time, measured in milliseconds since
00:00:00 GMT, January 1, 1970.
If -1, sets the last modified time to the current system time.true
if the time is set; false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean setLength(int length) throws java.lang.SecurityException
length
- The new length, in bytes.java.lang.SecurityException
- If the user is denied access to the file.public boolean setPath(java.lang.String path)
path
- The absolute file path.true
if the path was set;
false
otherwise.public void setPatternMatching(int patternMatching) throws java.io.IOException
patternMatching
- Either PATTERN_POSIX
, PATTERN_POSIX_ALL
, or PATTERN_OS2
java.io.IOException
- If an error occurs while communicating with the system.ConnectionDroppedException
- If the connection is dropped unexpectedly.ExtendedIOException
- If an error occurs while communicating with the system.ServerStartupException
- If the host server cannot be started.public boolean setReadOnly() throws java.lang.SecurityException
setReadOnly
in class java.io.File
true
if the read only attribute is set; false
otherwise.java.lang.SecurityException
- If the user is denied access to the file.public boolean setSystem(AS400 system)
system
- The system object.true
if the system was set;
false
otherwise.public boolean setExecutable(boolean executable) throws java.lang.SecurityException
An invocation of this method of the form file.setExcutable(arg) behaves in exactly the same way as the invocation file.setExecutable(arg, true)
setExecutable
in class java.io.File
executable
- If true, sets the access permission to allow execute operations; if false, to disallow execute operations.java.lang.SecurityException
- If the user is denied access to the file.public boolean setExecutable(boolean executable, boolean ownerOnly) throws java.lang.SecurityException
setExecutable
in class java.io.File
executable
- If true, sets the access permission to allow execute operations; if false, to disallow execute operations.ownerOnly
- If true, the execute permission applies only to the owner's execute permission; otherwise, it applies to everybody.java.lang.SecurityException
- If the user is denied access to the file.public boolean setReadable(boolean readable) throws java.lang.SecurityException
An invocation of this method of the form file.setReadable(arg) behaves in exactly the same way as the invocation file.setReadable(arg, true)
setReadable
in class java.io.File
readable
- If true, sets the access permission to allow read operations; if false, to disallow read operations.java.lang.SecurityException
- If the user is denied access to the file.public boolean setReadable(boolean readable, boolean ownerOnly) throws java.lang.SecurityException
setReadable
in class java.io.File
readable
- If true, sets the access permission to allow read operations; if false, to disallow read operations.ownerOnly
- If true, the read permission applies only to the owner's read permission; otherwise, it applies to everybody.java.lang.SecurityException
- If the user is denied access to the file.public boolean setWritable(boolean writable) throws java.lang.SecurityException
An invocation of this method of the form file.setWritable(arg) behaves in exactly the same way as the invocation file.setWritable(arg, true)
setWritable
in class java.io.File
writable
- If true, sets the access permission to allow write operations; if false to disallow write operationsjava.lang.SecurityException
- If the user is denied access to the file.public boolean setWritable(boolean writable, boolean ownerOnly) throws java.lang.SecurityException
setWritable
in class java.io.File
writable
- If true, sets the access permission to allow write operations; if false, to disallow write operations.ownerOnly
- If true, the write permission applies only to the owner's write permission; otherwise, it applies to everybody.java.lang.SecurityException
- If the user is denied access to the file.public java.lang.String toString()
toString
in class java.io.File
public java.net.URL toURL() throws java.net.MalformedURLException
file:
URL.
The IBM i file/directory will be accessed and if it is a directory the
resulting URL will end with the IBM i separator character
(forward slash). The system name will be obtained from
the AS400 object. If the path name or AS400 object has
not been set, a NullPointerException will be thrown.toURL
in class java.io.File
java.net.MalformedURLException
- If the URL cannot be formed.