|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
javax.ide.Service
javax.ide.net.VirtualFileSystem
public class VirtualFileSystem
The VirtualFileSystem class is responsible for encapsulating the notion of file system operations on content that is pointed to by an URI.
The behavior of VirtualFileSystem can be extended by subclasses of VirtualFileSystemHelper. An instance of VirtualFileSystemHelper is registered with VirtualFileSystem in association with a particular scheme. Scheme-specific behavior can thus be encapsulated by a specific implementation of VirtualFileSystemHelper. IDE implementations do not need to register an implementation of this service. The default registered implementation delegates most of its operations to registered VirtualFileSystemHelpers.
| Field Summary | |
|---|---|
static java.lang.String |
FILE_SCHEMEThe "file" URI scheme. |
static java.lang.String |
HTTP_SCHEMEThe "http" URI scheme. |
static java.lang.String |
JAR_SCHEMEThe "jar" URI scheme. |
| Constructor Summary | |
|---|---|
VirtualFileSystem() |
|
| Method Summary | |
|---|---|
void |
addExistsTest(URIExistsTest existsTest)Add an implementation of the URIExistsTest interface. |
boolean |
canCreate(java.net.URI uri)Tests whether the application can create the resource at the specified URI. |
java.net.URI |
canonicalize(java.net.URI uri)Returns a canonical form of the URI, if one is available. |
boolean |
canRead(java.net.URI uri)Tests whether the application can read the resource at the specified URI. |
boolean |
canWrite(java.net.URI uri)Tests whether the application can modify the resource at the specified URI. |
java.net.URI |
convertSuffix(java.net.URI uri, java.lang.String oldSuffix, java.lang.String newSuffix)Takes the given URI and checks if its Object.toString() representation ends with the specified oldSuffix. |
void |
copy(java.io.InputStream in, java.net.URI dst)Copies the contents of in to dst. |
void |
copy(java.net.URI src, java.io.File dst)Copies the contents of src to dst. |
void |
copy(java.net.URI src, java.net.URI dst)Copies the contents at src to dst. |
java.net.URI |
createTempFile(java.lang.String prefix, java.lang.String suffix, java.net.URI directory)Creates a new empty temporary file in the specified directory using the given prefix and suffix strings to generate its name. |
boolean |
delete(java.net.URI uri)Deletes the resource pointed to by the specified URI. |
java.net.URI |
ensureSuffix(java.net.URI uri, java.lang.String suffix)This method ensures that the specified URI ends with the specified suffix. |
boolean |
equals(java.net.URI uri1, java.net.URI uri2)Returns true if both of the specified URI parameters point to the same URI instance or if both URI parameters have the same scheme and the scheme helper determines that the URI objects are equal. |
boolean |
exists(java.net.URI uri)Tests whether a resource at the specified URI location currently exists. |
VirtualFileSystemHelper |
findHelper(java.lang.String scheme)Returns the VirtualFileSystemHelper class that is currently registered to handle operations related to the specified scheme. |
VirtualFileSystemHelper |
findHelper(java.net.URI uri)Returns the VirtualFileSystemHelper class that is currently registered to handle operations related to the specified URI. |
java.net.URI |
getBaseParent(java.net.URI uri, java.lang.String relativeSpec)This method gets the base directory fully containing the relative path. |
java.lang.String |
getFileName(java.net.URI uri)Returns the name of the file contained by the URI, not including any scheme, authority, directory path, query, or fragment. |
long |
getLength(java.net.URI uri)Returns the number of bytes contained in the resource that the specified URI points to. |
java.lang.String |
getName(java.net.URI uri)Returns the name of the file contained by the URI, not including any scheme, authority, directory path, file extension, query, or fragment. |
java.net.URI |
getParent(java.net.URI uri)Returns the URI representing the parent of the specified URI. |
java.lang.String |
getPath(java.net.URI uri)Returns the path part of the URI. |
java.lang.String |
getPathNoExt(java.net.URI uri)Returns the path part of the URI without the last file extension. |
java.lang.String |
getPlatformPathName(java.net.URI uri)Returns the platform-dependent String representation of the URI; the returned string should be considered acceptable for users to read. |
java.lang.String |
getSuffix(java.net.URI uri)If a dot ('.') occurs in the filename part of the path part of the URI, then all of the text starting at the last dot is returned, including the dot. |
static VirtualFileSystem |
getVirtualFileSystem()Gets the VirtualFileSystem implementation for this IDE. |
boolean |
hasSuffix(java.net.URI uri, java.lang.String suffix)Returns true if the path part of the URI ends with the given suffix String. |
boolean |
isBaseURIFor(java.net.URI uri1, java.net.URI uri2)Returns true if uri1 represents a a directory and uri2 points to a location within uri1's directory tree. |
boolean |
isBound(java.net.URI uri)This method tests whether the specified URI is bound to an existing resource, which may reside in memory (not yet saved) or already exist at the URI location. |
boolean |
isDirectory(java.net.URI uri)Tests whether the location indicated by the URI is a directory resource. |
boolean |
isDirectoryPath(java.net.URI uri)Tests whether the location indicated by the URI represents a directory path. |
boolean |
isHidden(java.net.URI uri)Tests whether the resource indiciated by the URI is a hidden file. |
static boolean |
isLocalFileSystemCaseSensitive()Returns true if the local file system is case sensitive. |
boolean |
isReadOnly(java.net.URI uri)Returns true if the resource is read-only. |
boolean |
isRegularFile(java.net.URI uri)Tests whether the resource indiciated by the URI is a regular file. |
boolean |
isRoot(java.net.URI uri)Returns true if the specified URI corresponds to the root of a file system; false otherwise. |
boolean |
isValid(java.net.URI uri)Tests whether the specified URI is valid. |
long |
lastModified(java.net.URI uri)Returns the last modified time of the resource pointed to by the URI. |
java.net.URI[] |
list(java.net.URI uri)Returns an array of URIs identifying resources in the directory resource indicated by the URI. |
java.net.URI[] |
list(java.net.URI uri, URIFilter filter)Returns an array of URIs identifying resources in the directory resource indicated by the URI; the specified URIFilter is applied to determine which URIs will be returned. |
java.net.URI[] |
listRoots()Returns an array of URIs that represent the root resources available. |
boolean |
mkdir(java.net.URI uri)Creates the directory indicated by the URI. |
boolean |
mkdirs(java.net.URI uri)Creates the directory indicated by the specified URI including any necessary but nonexistent parent directories. |
java.io.InputStream |
openInputStream(java.net.URI uri)Opens an InputStream for the location indicated by the specified URI. |
java.io.OutputStream |
openOutputStream(java.net.URI uri)Opens an OutputStream on the URI. |
void |
registerHelper(java.lang.String scheme, VirtualFileSystemHelper helper)Registers the specified VirtualFileSystemHelper as the object that can handle VirtualFileSystem operations for URIs of the specified scheme. |
boolean |
renameTo(java.net.URI oldURI, java.net.URI newURI)Renames the resource indicated by the first URI to the name indicated by the second URI. |
boolean |
setLastModified(java.net.URI uri, long time)Sets the last-modified timestamp of the resource indicated by the URI to the time specified by time. |
boolean |
setReadOnly(java.net.URI uri, boolean readOnly)Sets the read-only status of the resource indicated by the URI according to the specified readOnly flag. |
java.lang.String |
toDisplayString(java.net.URI uri)Returns a displayable form of the complete URI. |
java.lang.String |
toRelativeSpec(java.net.URI uri, java.net.URI base)Converts a uri to a relative spec. |
java.lang.String |
toRelativeSpec(java.net.URI uri, java.net.URI base, boolean mustConsumeBase)Converts a uri to a relative spec. |
java.net.URL |
toURL(java.net.URI uri)Get a URL from a URI. |
| Methods inherited from class javax.ide.Service |
|---|
getService, initialize, resetAllServices |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FILE_SCHEME
public static final java.lang.String HTTP_SCHEME
public static final java.lang.String JAR_SCHEME
| Constructor Detail |
|---|
public VirtualFileSystem()
| Method Detail |
|---|
public void registerHelper(java.lang.String scheme,
VirtualFileSystemHelper helper)
VirtualFileSystemHelper as the object that can handle VirtualFileSystem operations for URIs of the specified scheme.scheme - the URI scheme to register a helper for. Must not be null or an empty String.helper - the helper to register for the specified scheme. Must not be null.public VirtualFileSystemHelper findHelper(java.lang.String scheme)
VirtualFileSystemHelper class that is currently registered to handle operations related to the specified scheme. If there is no registered helper, then a default helper is returned that can produce a default result.scheme - the scheme to look up the helper for. Must not be null.public VirtualFileSystemHelper findHelper(java.net.URI uri)
VirtualFileSystemHelper class that is currently registered to handle operations related to the specified URI. If there is no registered helper, then a default helper is returned that can produce a default result.uri - a uri to find the helper for. May be null, in which case the default helper is returned.public void addExistsTest(URIExistsTest existsTest)
URIExistsTest interface. The existsTest object will be called by the isBound() method to determine if an URI is unique.existsTest - the implementation of an existence test for uris. Must not be null.
public java.net.URI canonicalize(java.net.URI uri)
throws java.io.IOException
URI, if one is available.uri - the uri to canonicalize.java.io.IOException - if the uri could not be canonicalized.VirtualFileSystemHelper.canonicalize( URI )public boolean canRead(java.net.URI uri)
URI.uri - the uri to check.true if and only if the specified URI points to a resource that exists and can be read by the application; false otherwise.VirtualFileSystemHelper.canRead( URI )public boolean canWrite(java.net.URI uri)
URI.uri - the uri to check.true if and only if the specified URI points to a file that exists and the application is allowed to write to the file; false otherwise.VirtualFileSystemHelper.canWrite( URI )public boolean canCreate(java.net.URI uri)
URI. This method tests that all components of the path can be created. If the resource pointed by the URI is read-only, this method returns false.uri - the uri to check.true if the resource at the specified URI exists or can be created; false otherwise.VirtualFileSystemHelper.canCreate( java.net.URI )public boolean isValid(java.net.URI uri)
URI is valid. If the resource pointed by the URI exists the method returns true. If the resource does not exist, the method tests that all components of the path can be created.uri - the uri to check.true if the URI is valid.VirtualFileSystemHelper.isValid( java.net.URI )
public java.net.URI convertSuffix(java.net.URI uri,
java.lang.String oldSuffix,
java.lang.String newSuffix)
URI and checks if its Object.toString() representation ends with the specified oldSuffix. If it does, the suffix is replaced with newSuffix. Both suffix parameters must include the leading dot ('.') if the dot is part of the suffix. If the specified URI does not end with the oldSuffix, then the newSuffix is simply appended to the end of the original URI.uri - the uri to check.oldSuffix - the old suffix to check for.newSuffix - the new suffix to use.VirtualFileSystemHelper.convertSuffix( URI, String, String )
public void copy(java.net.URI src,
java.net.URI dst)
throws java.io.IOException
src to dst. If the destination directory does not exist, it will be created. IOException is thrown if:
src - the uri of the resource to copy from. Must not be null.dst - the uri of the resource to copy to. Must not be null.java.io.IOException - if an error occurs copying the resource from the old uri to the new uri.
public void copy(java.io.InputStream in,
java.net.URI dst)
throws java.io.IOException
in to dst.in - an input stream to read data from. Must not be null.dst - a uri to copy data to. Must not be null.java.io.IOException - if an error occurs reading or writing.
public void copy(java.net.URI src,
java.io.File dst)
throws java.io.IOException
src to dst.src - the uri of a resource to read data from. Must not be null.dst - a file object to write data to. Must not be null.java.io.IOException - if an error occurs copying data.public boolean delete(java.net.URI uri)
URI. If the resource is a file (or analogous to a file), then the file is removed from its directory (or container). If the content is a directory (or analogous to a directory), then the directory is removed only if it is empty (i.e. contains no other files or directories).uri - the uri of the resource to delete.true if and only if the file or directory is successfully deleted; false otherwise.VirtualFileSystemHelper.delete( URI )
public java.net.URI ensureSuffix(java.net.URI uri,
java.lang.String suffix)
URI ends with the specified suffix. The suffix does not necessarily have to start with a ".", so if a leading "." is required, the specified suffix must contain it -- e.g. ".java", ".class".
If the URI already ends in the specified suffix, then the URI itself is returned. Otherwise, a new URI is created with the the specified suffix appended to the original URI's path part, and the new URI is returned.
uri - the uri to check. Must not be null.suffix - the suffix to ensure the specified uri has. Must not be null.URI, based on the specified URI, whose path part ends with the specified suffix.
public boolean equals(java.net.URI uri1,
java.net.URI uri2)
true if both of the specified URI parameters point to the same URI instance or if both URI parameters have the same scheme and the scheme helper determines that the URI objects are equal.uri1 - the first uri to compare.uri2 - the second uri to compare.equals(uri1,uri2).VirtualFileSystemHelper.equals( URI, URI )public boolean exists(java.net.URI uri)
URI location currently exists. The test for existence only checks the actual location and does not check any in-memory caches. To employ additional existential tests that do check in-memory caches, see isBound(URI).uri - the uri of a resource to check for existence. Must not be null.true if and only if a resource already exists at the specified URI location; false otherwise.VirtualFileSystemHelper.exists( URI )public java.lang.String getFileName(java.net.URI uri)
URI, not including any scheme, authority, directory path, query, or fragment. This simply returns the simple filename. For example, if you pass in an URI whose string representation is:
scheme://userinfo@host:1010/dir1/dir2/file.ext?query#fragment
the returned value is "file.ext" (without the quotes).uri - the uri to get the file name of. Must not be null.URI. This value should only be used for display purposes and not for opening streams or otherwise trying to locate the document.VirtualFileSystemHelper.getFileName( URI )public long getLength(java.net.URI uri)
URI points to. If the length cannot be determined, -1 is returned.uri - the uri of the resource to get the size of. Must not be null.URI.VirtualFileSystemHelper.getLength( URI )public java.lang.String getName(java.net.URI uri)
URI, not including any scheme, authority, directory path, file extension, query, or fragment. This simply returns the simple filename. For example, if you pass in an URI whose string representation is:
scheme://userinfo@host:1010/dir1/dir2/file.ext1.ext2?query#fragment
the returned value is "file" (without the quotes).
The returned file name should only be used for display purposes and not for opening streams or otherwise trying to locate the resource indicated by the URI.
uri - the uri to get the name of. Must not be null.VirtualFileSystemHelper.getName( URI )public java.net.URI getParent(java.net.URI uri)
URI representing the parent of the specified URI. If there is no parent then null is returned.uri - the uri of the resource to get the parent of. Must not be null.VirtualFileSystemHelper.getParent( URI )public java.lang.String getPath(java.net.URI uri)
URI. The returned string is acceptable to use in one of the URIFactory methods that takes a path.
This implementation delegates to URI.getPath().
uri - the uri to get the path of. Must not be null.VirtualFileSystemHelper.getPath( URI )public java.lang.String getPathNoExt(java.net.URI uri)
URI without the last file extension. To clarify, the following examples demonstrate the different cases:
URI |
String |
/dir/file.ext |
/dir/file |
/dir/file.ext1.ext2 |
/dir/file.ext1 |
/dir1.ext1/dir2.ext2/file.ext1.ext2 |
/dir1.ext1/dir2.ext2/file.ext1 |
/file.ext |
/file |
/dir.ext/file |
/dir.ext/file |
/dir/file |
/dir/file |
/file |
/file |
/.ext |
/ |
uri - the uri to get the path of without extension. Must not be null.VirtualFileSystemHelper.getPathNoExt( URI )public java.lang.String getPlatformPathName(java.net.URI uri)
URI; the returned string should be considered acceptable for users to read. In general, the returned string should omit as many parts of the URI as possible. For the "file" scheme, therefore, the platform pathname should just be the pathname alone (no scheme) using the appropriate file separator character for the current platform. For other schemes, it may be necessary to reformat the URI string into a more human-readable form. That decision is left to each VirtualFileSystemHelper implementation.uri - the uri of the resource to get the platform path name of. Must not be null.URI in platform-dependent notation. This value should only be used for display purposes and not for opening streams or otherwise trying to locate the document.VirtualFileSystemHelper.getPlatformPathName( URI )public java.lang.String getSuffix(java.net.URI uri)
URI, then all of the text starting at the last dot is returned, including the dot. If the last dot is also the last character in the path, then the dot by itself is returned. If there is no dot in the file name (even if a dot occurs elsewhere in the path), then the empty string is returned.
Examples:
uri - the uri to get the suffix of. Must not be null.VirtualFileSystemHelper.getSuffix( URI )
public boolean hasSuffix(java.net.URI uri,
java.lang.String suffix)
true if the path part of the URI ends with the given suffix String. The suffix can be any String and doesn't necessarily have to be one that begins with a dot ('.'). If you are trying to test whether the path part of the URI ends with a particular file extension, then the suffix parameter must begin with a '.' character to ensure that you get the right return value.uri - the uri to check. Must not be null.suffix - the suffix to check for. Must not be null.VirtualFileSystemHelper.hasSuffix( URI, String )
public boolean isBaseURIFor(java.net.URI uri1,
java.net.URI uri2)
true if uri1 represents a a directory and uri2 points to a location within uri1's directory tree.uri1 - the uri of a directory resource.uri2 - the uri of a resource.VirtualFileSystemHelper.isBaseURIFor( URI, URI )public boolean isBound(java.net.URI uri)
URI is bound to an existing resource, which may reside in memory (not yet saved) or already exist at the URI location. This is similar to exists(URI) but differs in that additional tests are applied that check whether the URI is bound to an in-memory object before the actual URI location is checked.
More precisely, "bound" means either that an URI is being used in such a way that a registered URIExistsTest is able to detect the URI's usage or that a document already exists at the URI location as determined by exists(URI)).
Checking for uniqueness of a newly generated URI is the primary use for this method.
uri - the uri to check, must not be null.public static boolean isLocalFileSystemCaseSensitive()
true if the local file system is case sensitive. Returns false if the local file system is not case sensitive.public boolean isDirectory(java.net.URI uri)
URI is a directory resource.uri - the uri to check. Must not be null.true if and only if the location indicated by the URI exists and is a directory; false otherwise.VirtualFileSystemHelper.isDirectory( URI )public boolean isDirectoryPath(java.net.URI uri)
URI represents a directory path. The directory path specified by the URI need not exist.
This method is intended to be a higher performance version of the isDirectory(URI) method. Implementations of this method should attempt to ascertain whether the specified URI represents a directory path by simply examining the URI itself. Time consuming i/o operations should be avoided.
uri - the uri to check. Must not be null.true if the location indicated by the URI represents a directory path; the directory path need not exist.VirtualFileSystemHelper.isDirectoryPath( URI )public boolean isHidden(java.net.URI uri)
URI is a hidden file. The exact definition of hidden is scheme-dependent and possibly system-dependent. On UNIX systems, a file is considered to be hidden if its name begins with a period character ('.'). On Win32 systems, a file is considered to be hidden if it has been marked as such in the file system.uri - the uri to check. Must not be null.VirtualFileSystemHelper.isHidden( URI )public boolean isReadOnly(java.net.URI uri)
true if the resource is read-only. A return value of false means that trying to get an OutputStream or trying to write to an OutputStream based on the URI will cause an IOException to be thrown. If the read-only status cannot be determined for some reason, this method returns true.uri - the uri of the resource to check. Must not be null.true if the document pointed to by the specified URI is read-only or if the read-only status cannot be determined; false otherwise.VirtualFileSystemHelper.isReadOnly( URI )public boolean isRegularFile(java.net.URI uri)
URI is a regular file. A regular is a file that is not a directory and, in addition, satisfies other system-dependent criteria.uri - the uri of the resource to check. Must not be null.true if and only if the resource indicated by the URI exists and is a normal file.VirtualFileSystemHelper.isRegularFile( URI )public boolean isRoot(java.net.URI uri)
true if the specified URI corresponds to the root of a file system; false otherwise.uri - the uri of a resource to check. Must not be null.public long lastModified(java.net.URI uri)
URI. The returned long is the number of milliseconds since the epoch (00:00:00 GMT Jan 1, 1970). If no timestamp is available, -1 is returned.uri - the uri of the resource to get the last modified time of. Must not be null.URI in milliseconds since the epoch.VirtualFileSystemHelper.lastModified( URI )public java.net.URI[] list(java.net.URI uri)
URIs identifying resources in the directory resource indicated by the URI. If the specified URI does not represent a directory, then this method returns null. Otherwise, an array of URIs is returned, one for each file or directory in the directory. URIs representing the directory itself or its parent are not included in the result. There is no guarantee that the URIs will be returned in any particular order.uri - the uri of a directory resource. Must not be null.URIs naming the files and directories in the directory indicated by the URI. The array will be empty if the directory is empty. Returns null if the URI does not represent a directory or if an I/O error occurs.VirtualFileSystemHelper.list( URI )
public java.net.URI[] list(java.net.URI uri,
URIFilter filter)
URIs identifying resources in the directory resource indicated by the URI; the specified URIFilter is applied to determine which URIs will be returned. If the specified URI does not represent a directory, then this method returns null. Otherwise, an array of URIs is returned, one for each file or directory in the directory that is accepted by the specified filter. URIs representing the directory itself or its parent are not included in the result. There is no guarantee that the URIs will occur in any particular order.
If the specified URIFilter is null then no filtering behavior is done.
uri - the uri of a directory resource. Must not be null.filter - a filter to use when retrieving the child resources of the specified uri. May be null, in which case no filtering is done.URIs naming the files and directories in the directory indicated by the URI that are accepted by the specified URIFilter. The array will be empty if the directory is empty. Returns null if the URI does not represent a directory or if an I/O error occurs.VirtualFileSystemHelper.list( URI, URIFilter )public java.net.URI[] listRoots()
URIs that represent the root resources available. The determination of the roots is delegated to each registered VirtualFileSystemHelper.VirtualFileSystemHelper.public boolean mkdir(java.net.URI uri)
URI.uri - the uri of a potential directory resource. Must not be null.true if and only if the directory was created; false otherwise.VirtualFileSystemHelper.mkdir( URI )public boolean mkdirs(java.net.URI uri)
URI including any necessary but nonexistent parent directories. Note that if this operation fails, it may have succeeded in creating some of the necessary parent directories. This method returns true if the directory was created along with all necessary parent directories or if the directories already exist; it returns false otherwise.uri - the uri of a potential directory resource. Must not be null.true if all directories were created successfully or exist; false if there was a failure somewhere. Note that even if false is returned, some directories may still have been created.VirtualFileSystemHelper.mkdirs( URI )
public java.net.URI createTempFile(java.lang.String prefix,
java.lang.String suffix,
java.net.URI directory)
throws java.io.IOException
prefix - The prefix string to be used in generating the file's name; must be at least three characters longsuffix - The suffix string to be used in generating the file's name; may be null, in which case the suffix ".tmp" will be useddirectory - The directory in which the file is to be created, or null if the default temporary-file directory is to be usedURI to the temporary file.java.io.IOException - if an error occurs creating the temporary file.VirtualFileSystemHelper.createTempFile( String, String, URI )
public java.io.InputStream openInputStream(java.net.URI uri)
throws java.io.IOException
InputStream for the location indicated by the specified URI.uri - An InputStream is opened on the given URI. Must not be null.InputStream associated with the URI.java.io.FileNotFoundException - if the resource at the specified URI does not exist.java.io.IOException - if an I/O error occurs when trying to open the InputStream.java.net.UnknownServiceException - (a runtime exception) if the scheme does not support opening an InputStream.VirtualFileSystemHelper.openInputStream( URI )
public java.io.OutputStream openOutputStream(java.net.URI uri)
throws java.io.IOException
OutputStream on the URI. If the file does not exist, the file should be created. If the directory path to the file does not exist, all necessary directories should be created.uri - An OutputStream is opened on the given URI. Must not be null.OutputStream associated with the URI.java.io.IOException - if an I/O error occurs when trying to open the OutputStream.java.net.UnknownServiceException - (a runtime exception) if the scheme does not support opening an OutputStream.VirtualFileSystemHelper.openOutputStream( URI )
public boolean renameTo(java.net.URI oldURI,
java.net.URI newURI)
URI to the name indicated by the second URI.
If either URI parameter is null or if both of the specified URI parameters refer to the same resource, then the rename is not attempted and failure is returned.
If the specified URI parameters do not have the same scheme, then the VirtualFileSystem handles the rename by first copying the resource to the destination with copy(URI, URI) and then deleting the original resource with delete(URI); if either operation fails, then failure is returned.
Otherwise, the scheme helper is called to perform the actual rename operation. Scheme helper implementations may therefore assume that both URI parameters are not null, do not refer to the same resource, and have the same scheme.
If the original URI refers to a nonexistent resource, then the scheme helper implementations should return failure. It is left up to the scheme helper implementations to decide whether to overwrite the destination or return failure if the destination URI refers to an existing resource.
oldURI - the URI of the original resourcenewURI - the desired URI for the renamed resourcetrue if and only if the resource is successfully renamed; false otherwise.
public boolean setLastModified(java.net.URI uri,
long time)
URI to the time specified by time. The time is specified in the number of milliseconds since the epoch (00:00:00 GMT Jan 1, 1970). The return value indicates whether or not the setting of the timestamp succeeded.uri - the uri of the resource to set the last modified timesamp of. Must not be null.time - a last modified timestamp in milliseconds since the epoch.VirtualFileSystemHelper.setLastModified( URI, long )
public boolean setReadOnly(java.net.URI uri,
boolean readOnly)
URI according to the specified readOnly flag. The return value indicates whether or not the setting of the read-only flag succeeded.uri - the uri of a resource to set the read only flag of. Must not be null.readOnly - whether the specified resource should be read only.VirtualFileSystemHelper.setReadOnly( URI, boolean )public java.lang.String toDisplayString(java.net.URI uri)
URI.uri - the uri of a resource. Must not be null.VirtualFileSystemHelper.toDisplayString( URI )
public java.lang.String toRelativeSpec(java.net.URI uri,
java.net.URI base)
uri - the uri to convert. Must not be null.base - the base uri.VirtualFileSystemHelper.toRelativeSpec( URI, URI )
public java.lang.String toRelativeSpec(java.net.URI uri,
java.net.URI base,
boolean mustConsumeBase)
uri - the uri to convert. Must not be null.base - the base uri.mustConsumeBase - If mustConsumeBase is false, then this method will return a non-null relative spec regardless of how much of the base URI is consumed during the determination.VirtualFileSystemHelper.toRelativeSpec( URI, URI )
public java.net.URI getBaseParent(java.net.URI uri,
java.lang.String relativeSpec)
uri - the uri to get the base directory for.relativeSpec - a relative path.VirtualFileSystemHelper.getBaseParent(URI, String)
public java.net.URL toURL(java.net.URI uri)
throws java.net.MalformedURLException
URL from a URI.uri - the URI to convert to a URL.java.net.MalformedURLException - if the uri could not be converted into a URL.public static VirtualFileSystem getVirtualFileSystem()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||