public abstract class VCSManager
extends java.lang.Object
VCSManager
is responsible for managing version control
system interactions in the IDE.Constructor and Description |
---|
VCSManager() |
Modifier and Type | Method and Description |
---|---|
void |
addVCSListener(VCSListener listener,
URLFilter filter)
Adds a
VCSListener to the VCSManager . |
abstract boolean |
canCheckOut(java.net.URL url)
Asks whether the given URL can be checked out through the version control
system.
|
abstract boolean |
checkOut(java.net.URL[] urls)
Executes check outs synchronously, and silently, on the calling thread.
|
abstract boolean |
checkOutNode(Node node)
Deprecated.
replaced by
checkOutUsingUI(VCSTask) . |
abstract boolean |
checkOutNode(Node node,
CommandProcessor processor)
Deprecated.
replaced by
checkOutUsingUI(VCSTask) and getMetaCheckOutCommand(Node) (depending on usage). |
abstract java.util.concurrent.Future<java.lang.Boolean> |
checkOutUsingUI(VCSTask task)
Executes check outs asynchronously, with UI, through the given runnable
task.
|
abstract boolean |
containsConflicts(java.net.URL url)
Asks whether the given URL contains diff3-style merge conflicts.
|
void |
deleteRecursively(java.net.URL url)
Deletes the given URL, recursively processing all directories.
|
void |
deleteRecursively(java.net.URL[] urls,
URLFilter filter,
boolean tolerant)
Deletes the given URLs, recursively processing all directories.
|
void |
deleteRecursively(java.net.URL[] urls,
URLFilter filter,
boolean tolerant,
java.util.Collection<java.net.URL> nonDeletedUrls)
Deletes the given URLs, recursively processing all directories.
|
void |
deleteRecursively(java.net.URL url,
URLFilter filter,
boolean tolerant)
Deletes the given URL, recursively processing all directories.
|
void |
deleteRecursively(java.net.URL url,
URLFilter filter,
boolean tolerant,
java.util.Collection<java.net.URL> nonDeletedUrls)
Deletes the given URL, recursively processing all directories.
|
void |
deregisterWorkspaceArtifact(java.lang.String path)
Deprecated.
not replaced.
|
protected abstract boolean |
executeTaskImpl(VCSTask task)
Implementation method.
|
abstract java.util.Collection<java.net.URL> |
getAllModifiedFiles(java.net.URL url)
Get all modified files within the working copy / tree / set
|
abstract java.lang.String |
getCheckOutCommand(Node node)
Deprecated.
replaced by
getMetaCheckOutCommand(Node node) |
protected java.util.Collection<NodeFilter> |
getCheckOutFilters() |
abstract Locatable[] |
getContextLocatables(Context context)
Gets the valid locatables from the context node selection.
|
abstract ContextMenuListener[] |
getContextMenuListeners()
Gets the list of context menu listeners currently registered against the
the
VCSManager . |
abstract MetaClass |
getMetaCheckOutCommand(Node node)
Gets the metaclass representation of the command provider for checking out Node instances
through the version control system.
|
abstract java.io.InputStream |
getRevisionContent(java.net.URL url,
java.lang.String revision)
Opens a
InputStream on the given URL for the revision identifier ( @link getRevisionIdentifier) |
abstract java.lang.String |
getRevisionIdentifier(java.net.URL url)
If the url is under version control return the revision identifer of the url.
|
protected java.util.Map |
getTaskProperties(VCSTask task)
Implementation method.
|
protected java.util.Map<VCSListener,URLFilter> |
getVCSListeners() |
static VCSManager |
getVCSManager()
Gets the
VCSManager instance that is active in the IDE. |
abstract java.lang.String |
getVersionName(java.net.URL url)
Gets a name representing the current version of the given URL.
|
protected java.util.Collection<java.lang.String> |
getWorkspaceArtifacts() |
abstract boolean |
isAutoCheckOutEnabled(java.net.URL url)
Deprecated.
not replaced. The test for the automatic check out preference
is encapsulated by check out operations.
|
abstract boolean |
isVersioned(java.net.URL url)
Asks whether the given URL represents a version controlled resource.
|
abstract java.io.InputStream |
openConflictsStreamAsContributor(java.net.URL url)
Opens an
InputStream on the given URL, which contains diff3-style
merge conflicts. |
void |
registerCheckOutFilter(NodeFilter filter)
Deprecated.
replaced by declarative registration through vcs-checkout-filter-hook.
|
void |
registerWorkspaceArtifact(java.lang.String path)
Deprecated.
replaced by declarative registration through vcs-workspace-artifact-hook.
|
void |
removeVCSListener(VCSListener listener)
Removes a
VCSListener from the VCSManager . |
abstract boolean |
setReadWrite(java.net.URL[] urls)
Deprecated.
replaced by
checkOut(URL[]) . |
static void |
setVCSManager(VCSManager vcsManager)
Sets the specified
VCSManager as the active instance in the IDE. |
abstract void |
validateStatus(java.net.URL url)
Validates the status of the given URL through the version control system.
|
abstract void |
validateStatus(java.net.URL[] urls) |
abstract void |
validateStatus(URLFilter filter)
Deprecated.
replaced by
validateStatus(URL[]) . |
public static VCSManager getVCSManager()
VCSManager
instance that is active in the IDE.VCSManager
instance.public static void setVCSManager(VCSManager vcsManager)
VCSManager
as the active instance in the IDE.vcsManager
- the VCSManager
instance.public abstract java.util.concurrent.Future<java.lang.Boolean> checkOutUsingUI(VCSTask task)
Files will be batch-processed if necessary to ensure the best performance
of the operation. Note that there are no preconditions for the URLs
passed to this method, which may or may not be read-only, checked in, or
version controlled. There is a guaranteed post-condition that, when the
result of the operation is true
, all given URLs are read/write
regardless of whether they have been checked out during the operation.
task
- the task to execute.public abstract boolean checkOut(java.net.URL[] urls)
Files will be batch-processed if necessary to ensure the best performance
of the operation. Note that there are no preconditions for the URLs
passed to this method, which may or may not be read-only, checked in, or
version controlled. There is a guaranteed post-condition that, when the
result of the operation is true
, all given URLs are read/write
regardless of whether they have been checked out during the operation.
urls
- the URLs to check out.public abstract boolean isVersioned(java.net.URL url)
url
- the URL to test.@Deprecated public abstract boolean isAutoCheckOutEnabled(java.net.URL url)
url
- the context URL to check for auto-checkout.public abstract boolean canCheckOut(java.net.URL url)
url
- the URL to test.@Deprecated public abstract boolean setReadWrite(java.net.URL[] urls)
checkOut(URL[])
.urls
- array of urls to make writable@Deprecated public abstract boolean checkOutNode(Node node)
checkOutUsingUI(VCSTask)
.node
- the Node for the command.@Deprecated public abstract boolean checkOutNode(Node node, CommandProcessor processor)
checkOutUsingUI(VCSTask)
and getMetaCheckOutCommand(Node)
(depending on usage).node
- the Node for the command.processor
- the command processor, which may be null
.@Deprecated public abstract java.lang.String getCheckOutCommand(Node node)
getMetaCheckOutCommand(Node node)
node
- the Node for the command.public abstract MetaClass getMetaCheckOutCommand(Node node)
node
- the Node for the command.public abstract void validateStatus(java.net.URL url)
url
- the URL whose status will be validated.@Deprecated public abstract void validateStatus(URLFilter filter)
validateStatus(URL[])
.filter
- a URLFilter
to constrain the URLs whose statuses
will be validated.public abstract void validateStatus(java.net.URL[] urls)
public final void addVCSListener(VCSListener listener, URLFilter filter)
VCSListener
to the VCSManager
.listener
- the VCS listener.filter
- a URLFilter
to constrain the URLs for which this
listener will receive notification. This is required in order to
receive events of type VCSEvent.FILE_MODIFIED
.public final void removeVCSListener(VCSListener listener)
VCSListener
from the VCSManager
.listener
- the VCS listener.protected final java.util.Map<VCSListener,URLFilter> getVCSListeners()
public abstract java.lang.String getVersionName(java.net.URL url)
@Deprecated public final void registerWorkspaceArtifact(java.lang.String path)
path
- a relative URL path to a file or directory.@Deprecated public final void deregisterWorkspaceArtifact(java.lang.String path)
path
- a relative URL path to a file or directory.protected final java.util.Collection<java.lang.String> getWorkspaceArtifacts()
@Deprecated public final void registerCheckOutFilter(NodeFilter filter)
filter
- a node filter controlling checkouts.protected final java.util.Collection<NodeFilter> getCheckOutFilters()
public abstract boolean containsConflicts(java.net.URL url)
openConflictsStreamAsContributor(java.net.URL)
. This
assists the prevention of parser failures and similar instabilities in the
product when dealing with files containing conflicts.url
- the URL.public abstract java.io.InputStream openConflictsStreamAsContributor(java.net.URL url) throws java.io.IOException
InputStream
on the given URL, which contains diff3-style
merge conflicts. The resulting stream is a partial reconstruction of the
local contributor to the conflicts file, before the merge. It is the same
as the contents of the conflicts file with all blocks from the local file
selected, and blocks from the conflicting file ignored.url
- the URL to open.InputStream
on the deconstructed conflicts file.java.io.IOException
- if an I/O error occurs while creating the input stream.public abstract ContextMenuListener[] getContextMenuListeners()
VCSManager
.oracle.ide.controller.ContextMenuListener}
public abstract Locatable[] getContextLocatables(Context context)
context
- the locatable context.protected abstract boolean executeTaskImpl(VCSTask task)
public abstract java.lang.String getRevisionIdentifier(java.net.URL url) throws java.lang.Exception
url
- URLjava.lang.Exception
public abstract java.io.InputStream getRevisionContent(java.net.URL url, java.lang.String revision) throws java.io.IOException
InputStream
on the given URL for the revision identifier ( @link getRevisionIdentifier)url
- URLrevision
- version revision identiferjava.io.IOException
- if an I/O error occurs while creating the input stream.public abstract java.util.Collection<java.net.URL> getAllModifiedFiles(java.net.URL url) throws java.lang.Exception
url
- - a location within the working copy / tree / setjava.lang.Exception
protected final java.util.Map getTaskProperties(VCSTask task)
public final void deleteRecursively(java.net.URL url) throws java.io.IOException, java.lang.InterruptedException
URLFileSystem.delete(java.net.URL)
, because measures are taken to reduce queries and
interactions with the version control system. This method may be slow to
complete and must be called from a non-event thread.url
- the url (regular file or directory resource) to delete.java.io.IOException
- if an I/O exception occurred while trying
to delete the URL
. The exception message will contain
details on why the deletion failed.java.lang.InterruptedException
public final void deleteRecursively(java.net.URL url, URLFilter filter, boolean tolerant) throws java.io.IOException, java.lang.InterruptedException
URLFileSystem.delete(java.net.URL)
, because measures are taken to reduce queries and
interactions with the version control system. This method may be slow to
complete and must be called from a non-event thread.url
- the url (regular file or directory resource) to delete.filter
- a filter to control deletions, accepting files to delete.
This value may be null
, in which case all files are
assumed to be deletable.tolerant
- a decision on whether to tolerate failed deletions.java.io.IOException
- if an I/O exception occurred while trying
to delete the URL
. The exception message will contain
details on why the deletion failed.java.lang.InterruptedException
public void deleteRecursively(java.net.URL url, URLFilter filter, boolean tolerant, java.util.Collection<java.net.URL> nonDeletedUrls) throws java.io.IOException, java.lang.InterruptedException
URLFileSystem.delete(java.net.URL)
, because measures are taken to reduce queries and
interactions with the version control system. This method may be slow to
complete and must be called from a non-event thread.url
- the url (regular file or directory resource) to delete.filter
- a filter to control deletions, accepting files to delete.
This value may be null
, in which case all files are
assumed to be deletable.tolerant
- a decision on whether to tolerate failed deletions.nonDeletedUrls
- Collection
in which to place URLs that
fail deletion. This value may also be null
java.io.IOException
- if an I/O exception occurred while trying
to delete the URL
. The exception message will contain
details on why the deletion failed.java.lang.InterruptedException
public final void deleteRecursively(java.net.URL[] urls, URLFilter filter, boolean tolerant) throws java.io.IOException, java.lang.InterruptedException
URLFileSystem.delete(java.net.URL)
, because measures are taken to reduce queries
and interactions with the version control system. The list of URLs is
coalesced before the deletions are performed to encourage correct and
optimal processing. This method may be slow to complete and must be
called from a non-event thread.urls
- the urls (regular files or directory resources) to delete.filter
- a filter to control deletions, accepting files to delete.
This value may be null
, in which case all files are
assumed to be deletable.tolerant
- a decision on whether to tolerate failed deletions.java.io.IOException
- if an I/O exception occurred while trying
to delete the URL
. The exception message will contain
details on why the deletion failed.java.lang.InterruptedException
public final void deleteRecursively(java.net.URL[] urls, URLFilter filter, boolean tolerant, java.util.Collection<java.net.URL> nonDeletedUrls) throws java.io.IOException, java.lang.InterruptedException
URLFileSystem.delete(java.net.URL)
, because measures are taken to reduce queries
and interactions with the version control system. The list of URLs is
coalesced before the deletions are performed to encourage correct and
optimal processing. This method may be slow to complete and must be
called from a non-event thread.urls
- the urls (regular files or directory resources) to delete.filter
- a filter to control deletions, accepting files to delete.
This value may be null
, in which case all files are
assumed to be deletable.tolerant
- a decision on whether to tolerate failed deletions.nonDeletedUrls
- Collection
in which to place URLs that
fail deletion. This value may also be null
java.io.IOException
- if an I/O exception occurred while trying
to delete the URL
. The exception message will contain
details on why the deletion failed.java.lang.InterruptedException