public class VersionHistoryURLHelper extends URLFileSystemHelper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROTOCOL |
Constructor and Description |
---|
VersionHistoryURLHelper() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFileName(java.net.URL url)
Returns the name of the file contained by the
URL , not
including any protocol, hostname authentication, directory path,
anchor, or query. |
java.lang.String |
getPlatformPathName(java.net.URL url)
Returns the platform-dependent String representation of the
URL ; the returned string should be considered acceptable
for users to read. |
static java.net.URL |
getRealURL(java.net.URL versionHistoryUrl) |
java.lang.String |
getSuffix(java.net.URL url)
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. |
static java.net.URL |
newHistoryURL(java.net.URL realUrl) |
java.io.InputStream |
openInputStream(java.net.URL url)
Opens an
InputStream on the specified URL . |
addURLFileSystemListener, appendRelativePath, areEqual, areEqualPathElems, canCreate, canDelete, canonicalize, canRead, canWrite, code, convertSuffix, createReader, createTempFile, delete, ensureSuffix, equals, exists, getBaseParent, getDefaultIcon, getLength, getName, getParent, getPath, getPathNoExt, getPort, getSystemDisplayName, getSystemIcon, getTempDirectory, hashCode, hasSuffix, haveSameAuthority, haveSameHost, haveSamePath, haveSamePort, haveSameProtocol, haveSameQuery, haveSameRef, haveSameUserInfo, isBaseURLFor, isDirectory, isDirectoryPath, isHidden, isLocal, isReadOnly, isRegularFile, isValid, lastModified, list, list, list, listRoots, ls, ls, lsCached, lsCached, mkdir, mkdirs, openOutputStream, removeURLFileSystemListener, rename, setLastModified, setReadOnly, toDisplayString, toEncodedString, toEncodedString, toRelativeSpec, toRelativeSpec, verifyList
public static final java.lang.String PROTOCOL
public static java.net.URL newHistoryURL(java.net.URL realUrl)
public static java.net.URL getRealURL(java.net.URL versionHistoryUrl)
public java.lang.String getFileName(java.net.URL url)
URLFileSystemHelper
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
.
getFileName
in class URLFileSystemHelper
public java.lang.String getPlatformPathName(java.net.URL url)
URLFileSystemHelper
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.getPlatformPathName
in class URLFileSystemHelper
URL
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.public java.lang.String getSuffix(java.net.URL url)
URLFileSystemHelper
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.getSuffix
in class URLFileSystemHelper
public java.io.InputStream openInputStream(java.net.URL url)
URLFileSystemHelper
InputStream
on the specified URL
.
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.
openInputStream
in class URLFileSystemHelper
IOException
,
URLConnection
,
UnknownServiceException