public final class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EVENT_ANNOTATIONS_CHANGED
Used to signal the Versioning manager that some annotations changed.
|
static String |
EVENT_STATUS_CHANGED
The NEW value is a Set of Files whose versioning status changed.
|
static String |
EVENT_VERSIONED_ROOTS
Indicates to the Versioning manager that the layout of versioned files may have changed.
|
Modifier and Type | Method and Description |
---|---|
static void |
addPropertyChangeListener(PropertyChangeListener l)
Add PropertyChangeListener to be notified about changes in the versioning infrastructure.
|
static void |
connectRepository(VCSSystemProvider.VersioningSystem versioningSystem,
String absolutePath)
Start again to manage the given path by the given versioning system
|
static VCSHistoryProvider.HistoryEntry |
createHistoryEntry(VCSFileProxy[] proxies,
Date dateTime,
String message,
String username,
String usernameShort,
String revision,
String revisionShort,
Action[] actions,
VCSHistoryProvider.RevisionProvider rp,
VCSHistoryProvider.MessageEditProvider mep,
VCSHistoryProvider.ParentProvider pp,
Object[] lookupObjects) |
static void |
disconnectRepository(VCSSystemProvider.VersioningSystem versioningSystem,
String absolutePath)
Stop managing the given path by the given versioning system
|
static void |
fireVisibilityChanged()
Notifies about visibility changes according to
VisibilityQueryImplementation |
static void |
fireVisibilityChanged(File... files)
Notifies about visibility changes according to
VisibilityQueryImplementation |
static void |
flushNullOwners()
Empties the file owner cache
|
static Object[] |
getDelegateEntry(VCSHistoryProvider.HistoryEntry entry) |
static String[] |
getDisconnectedRoots(VCSSystemProvider.VersioningSystem versioningSystem)
Returns all paths marked as not to managed by the given system
|
static File |
getFlat(String path)
Creates a File that is marked is flat (eg a java package), that is a folder
that contains only its direct children.
|
static VCSSystemProvider.VersioningSystem |
getLocalHistory(VCSFileProxy file)
Return the LoacalHistory VersioningSystem in case it is available for the given file
|
static VCSSystemProvider.VersioningSystem |
getOwner(VCSFileProxy proxy)
Queries the Versioning infrastructure for file ownership.
|
static boolean |
isFlat(File file)
Tests whether the given file represents a flat folder (eg a java package), that is a folder
that contains only its direct children.
|
static boolean |
isForbiddenFolder(VCSFileProxy folder)
Some folders are special and versioning should not look for metadata in
them.
|
static void |
removePropertyChangeListener(PropertyChangeListener l)
Remove PropertyChangeListener
|
static void |
versionedRootsChanged()
Notifies that a versioning system started to manage some previously unversioned files
(e.g.
|
public static final String EVENT_VERSIONED_ROOTS
public static final String EVENT_STATUS_CHANGED
public static final String EVENT_ANNOTATIONS_CHANGED
public static VCSSystemProvider.VersioningSystem getLocalHistory(VCSFileProxy file)
file
- a file for which the the LoacalHistory VersioningSystem has to be retrievedpublic static void disconnectRepository(VCSSystemProvider.VersioningSystem versioningSystem, String absolutePath)
versioningSystem
- the versioning system to stop manage for the given pathabsolutePath
- the path to stop managed by the given versioning systemUtils.connectRepository(org.netbeans.modules.versioning.core.util.VCSSystemProvider.VersioningSystem, java.lang.String)
public static void connectRepository(VCSSystemProvider.VersioningSystem versioningSystem, String absolutePath)
versioningSystem
- the versioning system to stop manage for the given pathabsolutePath
- the path to stop managed by the given versioning systemUtils.disconnectRepository(org.netbeans.modules.versioning.core.util.VCSSystemProvider.VersioningSystem, java.lang.String)
public static String[] getDisconnectedRoots(VCSSystemProvider.VersioningSystem versioningSystem)
versioningSystem
- the versioning systempublic static void flushNullOwners()
public static void fireVisibilityChanged()
VisibilityQueryImplementation
public static void fireVisibilityChanged(File... files)
VisibilityQueryImplementation
files
- the files with a changed visibilitypublic static void versionedRootsChanged()
public static VCSSystemProvider.VersioningSystem getOwner(VCSFileProxy proxy)
proxy
- public static boolean isFlat(File file)
file
- a File to testpublic static File getFlat(String path)
path
- a file pathpublic static void addPropertyChangeListener(PropertyChangeListener l)
l
- public static void removePropertyChangeListener(PropertyChangeListener l)
l
- public static Object[] getDelegateEntry(VCSHistoryProvider.HistoryEntry entry)
public static VCSHistoryProvider.HistoryEntry createHistoryEntry(VCSFileProxy[] proxies, Date dateTime, String message, String username, String usernameShort, String revision, String revisionShort, Action[] actions, VCSHistoryProvider.RevisionProvider rp, VCSHistoryProvider.MessageEditProvider mep, VCSHistoryProvider.ParentProvider pp, Object[] lookupObjects)
public static boolean isForbiddenFolder(VCSFileProxy folder)
VCSFileProxy.exists("/net/.git")
will freeze until it
timeouts. You should call this method before asking any I/O on children
of this folder you are unsure to actually exist. This does not mean
however that whole subtree should be excluded from version control, only
that you should not look for the metadata directly in this folder.
Returns true
if the given folder is among such folders.folder
- a folder to querytrue
if the given folder should be skipped when
searching for metadata.