public class VCSURLFileSystemHelper extends URLFileSystemHelperDecorator
Base class for URLFileSystem helper decorator objects suitable for version system integration.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_AUTO_CHECK_OUT_COMMENTS |
_helper
Constructor and Description |
---|
VCSURLFileSystemHelper(URLFileSystemHelper helper,
java.lang.String vcsId)
Constructor.
|
VCSURLFileSystemHelper(URLFileSystemHelper helper,
VCSExtension extension)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canCreate(java.net.URL url)
Tests whether the application can create the resource at the specified
URL . |
protected boolean |
canCreateImpl(java.net.URL url)
Can the given URL be created in the version system.
|
boolean |
canDelete(java.net.URL url)
Tests whether the application can delete the resource at the specified
URL . |
protected boolean |
canDeleteImpl(java.net.URL url)
Can the given URL be deleted in the version system.
|
void |
delete(java.net.URL url)
Deletes the content pointed to by the specified
URL . |
protected boolean |
deleteImpl(java.net.URL url)
Deletes the given URL through the version system.
|
void |
deleteRecursively(java.net.URL url,
URLFilter filter,
boolean tolerant,
java.util.Collection<java.net.URL> nonDeletedUrls) |
protected void |
invokeAndPushEventQueue(java.lang.Runnable r)
Invokes the given runnable, creating a temporary event queue to process
paint events if necessary.
|
protected boolean |
isAutoCheckoutsSet(java.net.URL url)
Asks whether the VCS preference for automatic checkouts is currently set.
|
boolean |
isEnabled()
Asks whether the file system helper decorator is enabled.
|
protected boolean |
isOperable(java.net.URL url) |
boolean |
isValid(java.net.URL url)
Tests whether the specified
URL is valid. |
protected boolean |
isValidImpl(java.net.URL url)
Is the given URL be valid for the version system.
|
java.io.OutputStream |
openOutputStream(java.net.URL url)
Opens an
OutputStream on the URL . |
void |
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 . |
protected boolean |
renameToImpl(java.net.URL oldUrl,
java.net.URL newUrl)
Renames the given URL through the version system.
|
void |
setEnabled(boolean enabled)
Sets whether the file system helper decorator is enabled.
|
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. |
protected boolean |
setReadWrite(java.net.URL url)
Sets the given URL read-write through the version system.
|
addURLFileSystemListener, canonicalize, canRead, canWrite, convertSuffix, createReader, createTempFile, ensureSuffix, equals, exists, getBaseParent, getDefaultIcon, getFileName, getHelper, getLength, getName, getParent, getPath, getPathNoExt, getPlatformPathName, getSuffix, getSystemDisplayName, getSystemIcon, hashCode, hasSuffix, insertNextDecorator, isBaseURLFor, isDirectory, isDirectoryPath, isHidden, isLocal, isReadOnly, isRegularFile, lastModified, list, list, ls, ls, lsCached, lsCached, mkdir, mkdirs, openInputStream, removeURLFileSystemListener, setLastModified, toDisplayString, toEncodedString, toRelativeSpec, toRelativeSpec
appendRelativePath, areEqual, areEqualPathElems, code, getPort, getTempDirectory, haveSameAuthority, haveSameHost, haveSamePath, haveSamePort, haveSameProtocol, haveSameQuery, haveSameRef, haveSameUserInfo, list, listRoots, toEncodedString, verifyList
public static final java.lang.String DEFAULT_AUTO_CHECK_OUT_COMMENTS
public VCSURLFileSystemHelper(URLFileSystemHelper helper, java.lang.String vcsId)
helper
- the delegate helper object.vcsId
- the VCS extension ID, allowing framework-level checkouts.public VCSURLFileSystemHelper(URLFileSystemHelper helper, VCSExtension extension)
helper
- the delegate helper object.extension
- the VCS extension, allowing framework-level checkouts.public void setEnabled(boolean enabled)
enabled
- the enabled value.public boolean isEnabled()
public boolean canCreate(java.net.URL url)
URLFileSystemHelper
URL
.canCreate
in class URLFileSystemHelperDecorator
true
if the resource at the specified URL
exists or can be created; false
otherwise.public boolean canDelete(java.net.URL url)
URLFileSystemHelper
URL
.canDelete
in class URLFileSystemHelperDecorator
true
if the resource at the specified URL
can be deleted.URLFileSystem.canDelete(URL)
public boolean isValid(java.net.URL url)
URLFileSystemHelper
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.isValid
in class URLFileSystemHelperDecorator
true
if the URL
is valid.public void delete(java.net.URL url) throws java.io.IOException
URLFileSystemHelper
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).The default implementation does nothing.
delete
in class URLFileSystemHelperDecorator
java.io.IOException
- if an I/O exception occurred when trying
to delete the URL.public void rename(java.net.URL oldUrl, java.net.URL newUrl) throws java.io.IOException
URLFileSystemHelper
URL
to the
name indicated by the second URL
.The default implementation does nothing.
rename
in class URLFileSystemHelperDecorator
java.io.IOException
- if an I/O exception occurs while renaming
the URL.URLFileSystem.renameTo(URL, URL)
,
URLFileSystem.renameEx(URL, URL)
public boolean setReadOnly(java.net.URL url, boolean readOnly)
URLFileSystemHelper
URL
according to the specified readOnly
flag. The return value indicates whether or not the setting
of the read-only flag succeeded.
The default implementation always returns false
without doing anything.
setReadOnly
in class URLFileSystemHelperDecorator
public java.io.OutputStream openOutputStream(java.net.URL url) throws java.io.IOException
URLFileSystemHelper
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.
openOutputStream
in class URLFileSystemHelperDecorator
java.io.IOException
- if an I/O error occurs when trying to open
the OutputStream
.java.net.UnknownServiceException
- if the
URLConnection
backing the specified URL
does not
support an OutputStream
.IOException
,
URLConnection
,
UnknownServiceException
protected boolean deleteImpl(java.net.URL url)
url
- the URL to be deleted.true
if and only if the file or directory
is successfully deleted; false
otherwise.URLFileSystemHelper.delete(java.net.URL)
protected boolean renameToImpl(java.net.URL oldUrl, java.net.URL newUrl)
oldUrl
- the URL to be renamed.newUrl
- the new URL location after renaming.true
if and only if the file or directory
is successfully renamed; false
otherwise.URLFileSystemHelperDecorator.rename(URL,URL)
protected boolean canCreateImpl(java.net.URL url)
url
- the URL location to be created.true
if and only if the file or directory
can be created; false
otherwise.URLFileSystemHelper.canCreate(java.net.URL)
protected boolean canDeleteImpl(java.net.URL url)
url
- the URL location to be deleted.true
if and only if the file or directory
can be deleted; false
otherwise.URLFileSystemHelper.canDelete(java.net.URL)
protected boolean isValidImpl(java.net.URL url)
url
- the URL location to be created.true
if and only if the url is valid;
false
otherwise.URLFileSystemHelper.canCreate(java.net.URL)
protected boolean setReadWrite(java.net.URL url)
url
- the URL to be made read-write.true
if and only if the file or directory
is successfully made read-write; false
otherwise.URLFileSystemHelper.setReadOnly(java.net.URL, boolean)
protected boolean isOperable(java.net.URL url)
protected boolean isAutoCheckoutsSet(java.net.URL url)
true
if the auto-checkouts are enabled by preferences.protected void invokeAndPushEventQueue(java.lang.Runnable r)
EventQueue.isDispatchThread()
calls during the current event dispatch to be unreliable. If assertions
based on isDispatchThread() are likely to follow before the next AWT event
can be processed, please avoid this method.r
- the runnable task.public final void deleteRecursively(java.net.URL url, URLFilter filter, boolean tolerant, java.util.Collection<java.net.URL> nonDeletedUrls) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException