Format is ide.res.dynamic.image://text[?params]. Avialable parameters: font: see Font.decode(String), bg: see Color.decode(String), fg: see Color.decode(String), padding: image padding around text boundaries. In the high-contrast mode specified foreground and background colors are ignored and WindowText and Window system colors are used instead.

lastModified(java.net.URL url)
Returns the last modification time (timestamp) of the resource indicated by the specified URL in milliseconds since 00:00:00 GMT, Jan 1, 1970.

java.net.URL[]

list(java.net.URL url)
Returns an array of URLs naming files and directories in the directory indicated by the URL.

java.net.URL[]

list(java.net.URL url, URLFilter filter)
Returns an array of URLs naming files and directories in the directory indicated by the URL; the specified URLFilter is applied to determine which URLs will be returned.

rename(java.net.URL oldURL, java.net.URL newURL)
Renames the resource indicated by the first URL to the name indicated by the second URL.

boolean

setLastModified(java.net.URL url, long time)
Sets the last-modified timestamp of the resource indicated by the URL to the time specified by time.

boolean

setReadOnly(java.net.URL url, boolean readOnly)
Sets the read-only status of the resource indicated by the URL according to the specified readOnly flag.

java.lang.String

toDisplayString(java.net.URL url)
Returns a displayable form of the complete URL.

java.lang.String

toRelativeSpec(java.net.URL url, java.net.URL base)
This method attempts all possible ways of deriving a relative URI reference as described in RFC 2396 using the url parameter as the URL whose relative URI reference is to be determined and the base parameter as the URL that serves as the base document for the url pararmeter.

openInputStream

The default implementation attempts to open the InputStream through the URLConnection associated with the URL. If the URLConnection implementation does not support an InputStream then an UnknownServiceException (a runtime exception) will be thrown.

openOutputStream

Opens an OutputStream on the URL. 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.

The default implementation attempts to open the OutputStream through the URLConnection associated with the URL. If the URLConnection implementation does not support an OutputStream then an UnknownServiceException (a runtime exception) will be thrown.

getSuffix

If a dot ('.') occurs in the path portion of the URL, 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 path, then the empty string is returned.

hasSuffix

Returns true if the path part of the URL 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 URL ends with a particular file extension, then the suffix parameter should begin with a '.' character to ensure that you get the right return value.

isValid

Tests whether the specified URL is valid. If the resource pointed by the URL exists the method returns true. If the resource does not exist, the method tests that all components of the path can be created.

convertSuffix

Takes the given URL 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 URL does not end with the oldSuffix, then the newSuffix is simply appended to the end of the original URL.

delete

Deletes the content pointed to by the specified URL. If the content 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).

ensureSuffix

This method ensures that the specified URL 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 URL already ends in the specified suffix, then the URL itself is returned. Otherwise, a new URL is created with the the specified suffix appended to the original URL's path part, and the new URL is returned.

The default implementation first checks with URLFileSystemHelper.hasSuffix(URL, String) to see if the URL already ends with the specified suffix. If not, the suffix is simply appended to the path part of the URL, and the new URL is returned.

equals

Compares the specified URL objects to determine whether they point to the same resource. This method returns true if the URLs point to the same resource and returns false if the URLs do not point to the same resource.

This method and all subclass implementations can assume that both URL parameters are not null. The URLFileSystem.equals(URL, URL) method is responsible for checking that the two URLs are not null.

It can also be assumed that both URL parameters have the same protocol and that the protocol is appropriate for this URLFileSystemHelper. This determination is also the responsibility of URLFileSystem.equals(URL, URL).

The default implementation for this method checks to see if the various parts of the URLs are equal. Unlike URL.equals(java.lang.Object), the host names are not resolved to InetAddresses.

It can also be assumed that the protocol is appropriate for this URLFileSystemHelper. The URLFileSystem.hashCode(URL) method is also responsible for ensuring this condition and for incorporating the protocol into the hash code.

The default implementation for this method computes the hash code from the hash codes of the various parts of the URLs are equal. Unlike URL.equals(java.lang.Object), the host names is not resolved to an InetAddress.

getFileName

Returns the name of the file contained by the URL, not including any protocol, hostname authentication, directory path, anchor, or query. This simply returns the simple filename. For example, if you pass in an URL whose string representation is:

protocol://host:1010/dir1/dir2/file.ext#anchor?query

the returned value is "file.ext" (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 URL.

getLength

Returns the number of bytes contained in the resource that the specified URL points to. If the length cannot be determined, -1 is returned.

The default implementation attempts to get the content length from the URLConnection associated with the URL. If that fails for some reason (e.g. the resource does not exist, there was some other an I/O exception, etc.), -1 is returned.

getName

Returns the name of the file contained by the URL, not including any protocol, hostname authentication, directory path, anchor, or query. This simply returns the simple filename. For example, if you pass in an URL whose string representation is:

protocol://host:1010/dir1/dir2/file.ext1.ext2#anchor?query

the returned value is "file.ext1" (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 URL.

The default implementation first calls URLFileSystemHelper.getFileName(URL) to get the file name part. Then all characters starting with the last occurrence of '.' are removed. The remaining string is then returned.

Note: The implementation of this method changed in the 11.1.1 release of the platform to trim the filename on the last '.'. In previous releases of the platform, it would trim the filename on the first '.'.

getPathNoExt

Returns the path part of the URL without the last file extension. To clarify, the following examples demonstrate the different cases that come up:

Path part of input URL

Output 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

/

The default implementation gets the path from URLFileSystemHelper.getPath(URL) and then trims off all of the characters beginning with the last "." in the path, if and only if the last "." comes after the last "/" in the path. If the last "." comes before the last "/" or if there is no "." at all, then the entire path is returned.

getPlatformPathName

Returns the platform-dependent String representation of the URL; the returned string should be considered acceptable for users to read. In general, the returned string should omit as many parts of the URL as possible. For the "file" protocol, therefore, the platform pathname should just be the pathname alone (no protocol) using the appropriate file separator character for the current platform. For other protocols, it may be necessary to reformat the URL string into a more human-readable form. That decision is left to each URLFileSystemHelper implementor. The default implementation returns url.toString(). If the URL is null, the empty string is returned.

isDirectoryPath

Tests whether the location indicated by the URL represents a directory path. The directory path specified by the URL need not exist.

This method is intended to be a higher performance version of the URLFileSystemHelper.isDirectory(URL) method. Implementations of this method should attempt to ascertain whether the specified URL represents a directory path by simply examining the URL itself. Time consuming i/o operations should be avoided.

The default implementation returns true if the path part of the URL ends with a '/' and the query and ref parts of the URL are null.

isHidden

Tests whether the resource indiciated by the URL is a hidden file. The exact definition of hidden is protocol-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.

isReadOnly

Returns 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 URL will cause an exception to be thrown.

The default implementation always returns true. This means that all resources are considered read-only unless a protocol-specific URLFileSystemHelper is registered for the specified URL and is able to determine that the resource underlying the specified URL is not read-only.

lastModified

Returns the last modification time (timestamp) of the resource indicated by the specified URL in milliseconds since 00:00:00 GMT, Jan 1, 1970. If the timestamp can't be determined, -1 is returned.

The default implementation attemps to get the last modified time from the URLConnection associated with the URL. If that fails for some reason (e.g. the resource does not exist, there was some other I/O exception, etc.), -1 is returned.

list

Returns an array of URLs naming files and directories in the directory indicated by the URL. If the specified URL does not represent a directory, then this method returns null. Otherwise, an array of URLs is returned, one for each file or directory in the directory. URLs representing the directory itself or its parent are not included in the result. There is no guarantee that the URLs will occur in any particular order.

An array of URLs naming the files and directories in the directory indicated by the URL. The array will be empty if the directory is empty. Returns null if the URL does not represent a directory or if an I/O error occurs.

list

Returns an array of URLs naming files and directories in the directory indicated by the URL; the specified URLFilter is applied to determine which URLs will be returned. If the specified URL does not represent a directory, then this method returns null. Otherwise, an array of URLs is returned, one for each file or directory in the directory that is accepted by the specified filter. URLs representing the directory itself or its parent are not included in the result. There is no guarantee that the URLs will occur in any particular order.

An array of URLs naming the files and directories in the directory indicated by the URL that are accepted by the specified URLFilter. The array will be empty if the directory is empty. Returns null if the URL does not represent a directory or if an I/O error occurs.

mkdirs

Creates the directory indicated by the specified URL 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.

setLastModified

Sets the last-modified timestamp of the resource indicated by the URL 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.

toRelativeSpec

This method attempts all possible ways of deriving a relative URI reference as described in RFC 2396 using the url parameter as the URL whose relative URI reference is to be determined and the base parameter as the URL that serves as the base document for the url pararmeter. If it is not possible to produce a relative URI reference because the two URLs are too different, then a full, absolute reference for the url parameter is returned.

Whatever value is returned by this method, it can be used in conjunction with the baseURL to reconstruct the fully-qualified URL by using one of the URL constructors that takes a context URL plus a String spec (i.e. the String returned by this method).

Both the url and base parameters should point to documents and be absolute URLs. Specifically, the base parameter does not need to be modified to represent the base directory if the base parameter already points to a document that is in the directory to which the url parameter will be made relative. This relationship between url and base is exactly how relative references are treated within HTML documents. Relative references in an HTML page are resolved against the HTML page's base URL. The base URL is the HTML page itself, not the directory that contains it.

If either the url or base parameter needs to represent a directory rather than a file, they must end with a "/" in the path part of the URL, such as:

http://host.com/root/my_directory/

The algorithm used by this method to determine the relative reference closely follows the recommendations made in RFC 2396. The following steps are performed, in order, to determine the relative reference:

The protocol parts are checked first. If they do not match exactly, then an absolute reference is returned.

The authority parts are checked next. If they do not match exactly, then an absolute reference is returned.

If the protocol and authority parts match exactly, then it is possible to calculate a relative reference. The path parts are then compared element-by-element to determine the relative path, using the following steps, in order:

If no path elements are in common, then an absolute path is used and relative-path determination stops.

Otherwise, any path parts that are in common are omitted from the relative path. Comparison of path elements when the protocol is "file" is done using instance of File so that, for example, on Win32 the comparison is case-insensitive, whereas on Unix the comparison is case-sensitive. When the protocol is not "file", comparison is always case-sensitive. (This distinction is made by FileURLFileSystemHelper, which overrides the relevant part of the algorithm.)

If, after matching as many path elements as possible, there are still path elements remaining in the base URL (except for the document name itself), then a "../" sequence is prepended to the resulting relative path for each base path element that was not consumed while matching path elements.

If not all of the path elements in url were consumed, then those path elements are appended to the resulting relative path as well. If the first remaining path element in url contains a ':' character and there is no "../" sequence was prepended to the relative reference, then a "./" sequence is prepended to prevent the ':' character from being interpreted as a protocol delimiter (this is a special case in RFC 2396).

After the path part has been processed, no further processing is done. In particular, the query part and path part of the url are not appended.

This method is implemented using the template method design pattern, so it is possible for subclasses to override just part of the algorithm in order to handle protocol-specific details.

If mustConsumeBase is true, then this method will return a non-null relative spec if and only if the base URL was fully consumed in the process of calculating the relative spec. Otherwise, if any part of the base URL remained, then this method returns null.

If mustConsumeBase is false, then this method will return a non-null relative spec regardless of how much of the base URL is consumed during the determination.

getBaseParent

This method gets the base directory fully containing the relative path. The url should be absolute and point to a directory. It must end with a "/" in the path part of the URL, such as:

http://host.com/root/my_directory/

If the url does not end with a "/", it will be assumed that the url points to a document. The document name will then be stripped in order to determine the parent directory. The relativeSpec parameter should be a relative path. If the relativeSpec does not end with a "/", it will be assumed that the relativeSpec points to a document. The document name will then be stripped in order to determine the parent directory. For example, if the url points to:

file://c:/root/dir1/dir2/dir3/

and the relativeSpec is:

dir2/dir3

The returned value would be:

file://c:/root/dir1/

If the relativeSpec path elements are not fully contained in the last part of the url path the value returned is the url itself if the url path ends with a "/" or the url parent otherwise.