com.ibm.security12.java.io
Class File12
java.lang.Object
|
+--java.io.File
|
+--com.ibm.security12.java.io.File12
- public class File12
- extends File
File12 is an improved version of java.io.File.
JDK 1.2 introduces a new method to java.io.File: toURL().
The toURL() method returns a file:
URL converted from
the absolute pathname of the file. The functionality was required
by other Migration Aid classes but developers could also use toURL()
in applications by converting File objects to File12 objects and
then calling toURL(). The following examples illustrate two ways to
implement toURL() in order to retrieve a keystore file URL.
. . .
File keystore = new File("c:/temp/keystore.file");
// File12 object from File object using getPath():
File12 ksf = new File12(keystore.getPath());
URL ksfURL = ksf.toRUL();
. . .
and
. . .
File keystore = new File("c:/temp/keystore.file");
URL ksfURL = new File12(keystore.getPath()).toURL();
. . .
- Version:
- 1.1, 98/05/27
- Author:
- D. Kent Soper
- See Also:
- Serialized Form
Constructor Summary |
File12(String path)
Creates a File12 instance that represents the file
whose pathname is the given path argument. |
Method Summary |
URL |
toURL()
Converts this abstract pathname into a file: URL. |
Methods inherited from class java.io.File |
canRead,
canWrite,
compareTo,
compareTo,
createNewFile,
createTempFile,
createTempFile,
delete,
deleteOnExit,
equals,
exists,
getAbsoluteFile,
getAbsolutePath,
getCanonicalFile,
getCanonicalPath,
getName,
getParent,
getParentFile,
getPath,
hashCode,
isAbsolute,
isDirectory,
isFile,
isHidden,
lastModified,
length,
list,
list,
listFiles,
listFiles,
listFiles,
listRoots,
mkdir,
mkdirs,
renameTo,
setLastModified,
setReadOnly,
toString |
File12
public File12(String path)
- Creates a
File12
instance that represents the file
whose pathname is the given path argument.
- Parameters:
path
- the file pathname.- See Also:
File.getPath()
toURL
public URL toURL()
throws MalformedURLException
- Converts this abstract pathname into a
file:
URL. The
exact form of the URL is system-dependent. If it can be determined that
the file denoted by this abstract pathname is a directory, then the
resulting URL will end with a slash.
- Overrides:
- toURL in class File
- See Also:
URL