Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.jdeveloper.vcs.spi
Class VCSURLFileSystemHelper

java.lang.Object
  extended by oracle.ide.net.URLFileSystemHelper
      extended by oracle.ide.net.URLFileSystemHelperDecorator
          extended by oracle.jdeveloper.vcs.spi.VCSURLFileSystemHelper

public class VCSURLFileSystemHelper
extends URLFileSystemHelperDecorator

Base class for URLFileSystem helper decorator objects suitable for version system integration.

Since:
9.0.5

Field Summary
static java.lang.String DEFAULT_AUTO_CHECK_OUT_COMMENTS
           
 
Fields inherited from class oracle.ide.net.URLFileSystemHelperDecorator
_helper
 
Constructor Summary
VCSURLFileSystemHelper(URLFileSystemHelper helper, java.lang.String vcsId)
          Constructor.
VCSURLFileSystemHelper(URLFileSystemHelper helper, VCSExtension extension)
          Constructor.
 
Method Summary
 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.
 
Methods inherited from class oracle.ide.net.URLFileSystemHelperDecorator
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, listRoots, ls, ls, lsCached, lsCached, mkdir, mkdirs, openInputStream, removeURLFileSystemListener, setLastModified, toDisplayString, toEncodedString, toRelativeSpec, toRelativeSpec
 
Methods inherited from class oracle.ide.net.URLFileSystemHelper
appendRelativePath, areEqual, areEqualPathElems, code, getPort, getTempDirectory, haveSameAuthority, haveSameHost, haveSamePath, haveSamePort, haveSameProtocol, haveSameQuery, haveSameRef, haveSameUserInfo, list, toEncodedString, verifyList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_AUTO_CHECK_OUT_COMMENTS

public static final java.lang.String DEFAULT_AUTO_CHECK_OUT_COMMENTS
Constructor Detail

VCSURLFileSystemHelper

public VCSURLFileSystemHelper(URLFileSystemHelper helper,
                              java.lang.String vcsId)
Constructor.

Parameters:
helper - the delegate helper object.
vcsId - the VCS extension ID, allowing framework-level checkouts.

VCSURLFileSystemHelper

public VCSURLFileSystemHelper(URLFileSystemHelper helper,
                              VCSExtension extension)
Constructor.

Parameters:
helper - the delegate helper object.
extension - the VCS extension, allowing framework-level checkouts.
Method Detail

setEnabled

public void setEnabled(boolean enabled)
Sets whether the file system helper decorator is enabled.

Parameters:
enabled - the enabled value.

isEnabled

public boolean isEnabled()
Asks whether the file system helper decorator is enabled.

Returns:
the enabled value.

canCreate

public boolean canCreate(java.net.URL url)
Description copied from class: URLFileSystemHelper
Tests whether the application can create the resource at the specified URL.

Overrides:
canCreate in class URLFileSystemHelperDecorator
Returns:
true if the resource at the specified URL exists or can be created; false otherwise.

canDelete

public boolean canDelete(java.net.URL url)
Description copied from class: URLFileSystemHelper
Tests whether the application can delete the resource at the specified URL.

Overrides:
canDelete in class URLFileSystemHelperDecorator
Returns:
true if the resource at the specified URL can be deleted.
See Also:
URLFileSystem.canDelete(URL)

isValid

public boolean isValid(java.net.URL url)
Description copied from class: URLFileSystemHelper
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.

Overrides:
isValid in class URLFileSystemHelperDecorator
Returns:
true if the URL is valid.

delete

public void delete(java.net.URL url)
            throws java.io.IOException
Description copied from class: URLFileSystemHelper
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).

The default implementation does nothing.

Overrides:
delete in class URLFileSystemHelperDecorator
Throws:
java.io.IOException - if an I/O exception occurred when trying to delete the URL.

rename

public void rename(java.net.URL oldUrl,
                   java.net.URL newUrl)
            throws java.io.IOException
Description copied from class: URLFileSystemHelper
Renames the resource indicated by the first URL to the name indicated by the second URL.

The default implementation does nothing.

Overrides:
rename in class URLFileSystemHelperDecorator
Throws:
java.io.IOException - if an I/O exception occurs while renaming the URL.
See Also:
URLFileSystem.renameTo(URL, URL), URLFileSystem.renameEx(URL, URL)

setReadOnly

public boolean setReadOnly(java.net.URL url,
                           boolean readOnly)
Description copied from class: URLFileSystemHelper
Sets the read-only status of the resource indicated by the 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.

Overrides:
setReadOnly in class URLFileSystemHelperDecorator

openOutputStream

public java.io.OutputStream openOutputStream(java.net.URL url)
                                      throws java.io.IOException
Description copied from class: URLFileSystemHelper
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.

Overrides:
openOutputStream in class URLFileSystemHelperDecorator
Throws:
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.
See Also:
IOException, URLConnection, UnknownServiceException

deleteImpl

protected boolean deleteImpl(java.net.URL url)
Deletes the given URL through the version system. Override this method to perform a file removal.

Parameters:
url - the URL to be deleted.
Returns:
true if and only if the file or directory is successfully deleted; false otherwise.
See Also:
URLFileSystemHelper.delete(java.net.URL)

renameToImpl

protected boolean renameToImpl(java.net.URL oldUrl,
                               java.net.URL newUrl)
Renames the given URL through the version system. Override this method to perform a file move.

Parameters:
oldUrl - the URL to be renamed.
newUrl - the new URL location after renaming.
Returns:
true if and only if the file or directory is successfully renamed; false otherwise.
See Also:
URLFileSystemHelperDecorator.rename(URL,URL)

canCreateImpl

protected boolean canCreateImpl(java.net.URL url)
Can the given URL be created in the version system. Override this method to to enable url to be created.

Parameters:
url - the URL location to be created.
Returns:
true if and only if the file or directory can be created; false otherwise.
See Also:
URLFileSystemHelper.canCreate(java.net.URL)

canDeleteImpl

protected boolean canDeleteImpl(java.net.URL url)
Can the given URL be deleted in the version system. Override this method to to enable url to be deleted.

Parameters:
url - the URL location to be deleted.
Returns:
true if and only if the file or directory can be deleted; false otherwise.
See Also:
URLFileSystemHelper.canDelete(java.net.URL)

isValidImpl

protected boolean isValidImpl(java.net.URL url)
Is the given URL be valid for the version system. Override this method to to enable url to be created.

Parameters:
url - the URL location to be created.
Returns:
true if and only if the url is valid; false otherwise.
See Also:
URLFileSystemHelper.canCreate(java.net.URL)

setReadWrite

protected boolean setReadWrite(java.net.URL url)
Sets the given URL read-write through the version system. Override this method to perform a file checkout.

Parameters:
url - the URL to be made read-write.
Returns:
true if and only if the file or directory is successfully made read-write; false otherwise.
See Also:
URLFileSystemHelper.setReadOnly(java.net.URL, boolean)

isOperable

protected boolean isOperable(java.net.URL url)

isAutoCheckoutsSet

protected boolean isAutoCheckoutsSet(java.net.URL url)
Asks whether the VCS preference for automatic checkouts is currently set.

Returns:
true if the auto-checkouts are enabled by preferences.

invokeAndPushEventQueue

protected void invokeAndPushEventQueue(java.lang.Runnable r)
Invokes the given runnable, creating a temporary event queue to process paint events if necessary. This helps avoid a GUI freeze if the calling thread is the AWT event dispatcher and the task is long-running. Warning: this technique causes subsequent 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.

Parameters:
r - the runnable task.

deleteRecursively

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
Throws:
java.io.IOException
java.lang.InterruptedException

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.