public class JGitFileSystemProvider extends Object implements org.uberfire.java.nio.security.SecuredFileSystemProvider, org.uberfire.commons.lifecycle.Disposable
| Modifier and Type | Class and Description |
|---|---|
class |
JGitFileSystemProvider.RepositoryResolverImpl<T> |
| Modifier and Type | Field and Description |
|---|---|
static String |
DAEMON_DEFAULT_ENABLED |
static String |
DAEMON_DEFAULT_PORT |
static String |
DEFAULT_COMMIT_LIMIT_TO_GC |
static String |
DEFAULT_HOST_ADDR |
static String |
DEFAULT_HOST_NAME |
protected static String |
DEFAULT_IO_SERVICE_NAME |
static String |
GIT_DAEMON_ENABLED |
static String |
GIT_ENV_KEY_DEFAULT_REMOTE_NAME |
static String |
GIT_ENV_KEY_DEST_PATH |
static String |
GIT_ENV_KEY_INIT |
static String |
GIT_ENV_KEY_LIST_MODE
Specifies the list mode for the repository parent directory.
|
static String |
GIT_ENV_KEY_PASSWORD |
static String |
GIT_ENV_KEY_USER_NAME |
static String |
GIT_NIO_DIR |
static String |
GIT_NIO_DIR_NAME |
static String |
GIT_SSH_ENABLED |
static String |
REPOSITORIES_CONTAINER_DIR |
static String |
SSH_ALGORITHM |
static String |
SSH_CERT_PASSPHRASE |
static String |
SSH_DEFAULT_ENABLED |
static String |
SSH_DEFAULT_PORT |
static String |
SSH_FILE_CERT_CONTAINER_DIR |
static String |
SSH_IDLE_TIMEOUT |
| Constructor and Description |
|---|
JGitFileSystemProvider()
Creates a JGit filesystem provider which takes its configuration from system properties.
|
JGitFileSystemProvider(org.uberfire.commons.config.ConfigProperties gitPrefs)
Creates a JGit filesystem provider which takes its configuration from the given ConfigProperties instance.
|
JGitFileSystemProvider(Map<String,String> gitPrefs)
Creates a JGit filesystem provider which takes its configuration from the given map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkAccess(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.AccessMode... modes) |
void |
copy(org.uberfire.java.nio.file.Path source,
org.uberfire.java.nio.file.Path target,
org.uberfire.java.nio.file.CopyOption... options) |
void |
createDirectory(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) |
void |
createLink(org.uberfire.java.nio.file.Path link,
org.uberfire.java.nio.file.Path existing) |
void |
createSymbolicLink(org.uberfire.java.nio.file.Path link,
org.uberfire.java.nio.file.Path target,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) |
void |
delete(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.DeleteOption... options) |
void |
deleteAsset(JGitPathImpl path,
org.uberfire.java.nio.file.DeleteOption... options) |
boolean |
deleteAssetIfExists(JGitPathImpl path,
org.uberfire.java.nio.file.DeleteOption... options) |
void |
deleteBranch(JGitPathImpl path) |
boolean |
deleteBranchIfExists(JGitPathImpl path) |
boolean |
deleteIfExists(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.DeleteOption... options) |
void |
dispose() |
protected boolean |
exists(org.uberfire.java.nio.file.Path path) |
String |
extractHost(URI uri) |
String |
extractOldHost(URI uri) |
String |
extractOldPath(URI uri) |
String |
extractPath(URI uri) |
String |
extractRepoNameWithFolder(URI uri) |
void |
forceAsDefault() |
<V extends org.uberfire.java.nio.file.attribute.FileAttributeView> |
getFileAttributeView(org.uberfire.java.nio.file.Path path,
Class<V> type,
org.uberfire.java.nio.file.LinkOption... options) |
org.uberfire.java.nio.file.FileStore |
getFileStore(org.uberfire.java.nio.file.Path path) |
org.uberfire.java.nio.file.FileSystem |
getFileSystem(URI uri) |
File |
getGitRepoContainerDir()
Returns the directory that contains all the git repositories managed by this file system provider.
|
Set<JGitFileSystem> |
getOpenFileSystems() |
org.uberfire.java.nio.file.Path |
getPath(URI uri) |
String |
getScheme() |
boolean |
isDefault() |
boolean |
isHidden(org.uberfire.java.nio.file.Path path) |
boolean |
isSameFile(org.uberfire.java.nio.file.Path pathA,
org.uberfire.java.nio.file.Path pathB) |
void |
move(org.uberfire.java.nio.file.Path source,
org.uberfire.java.nio.file.Path target,
org.uberfire.java.nio.file.CopyOption... options) |
org.uberfire.java.nio.channels.AsynchronousFileChannel |
newAsynchronousFileChannel(org.uberfire.java.nio.file.Path path,
Set<? extends org.uberfire.java.nio.file.OpenOption> options,
ExecutorService executor,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) |
org.uberfire.java.nio.channels.SeekableByteChannel |
newByteChannel(org.uberfire.java.nio.file.Path path,
Set<? extends org.uberfire.java.nio.file.OpenOption> options,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) |
org.uberfire.java.nio.file.DirectoryStream<org.uberfire.java.nio.file.Path> |
newDirectoryStream(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.DirectoryStream.Filter<org.uberfire.java.nio.file.Path> pfilter) |
FileChannel |
newFileChannel(org.uberfire.java.nio.file.Path path,
Set<? extends org.uberfire.java.nio.file.OpenOption> options,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) |
org.uberfire.java.nio.file.FileSystem |
newFileSystem(org.uberfire.java.nio.file.Path path,
Map<String,?> env) |
org.uberfire.java.nio.file.FileSystem |
newFileSystem(URI uri,
Map<String,?> env) |
InputStream |
newInputStream(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.OpenOption... options) |
OutputStream |
newOutputStream(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.OpenOption... options) |
void |
onCloseFileSystem(JGitFileSystem fileSystem) |
void |
onDisposeFileSystem(JGitFileSystem fileSystem) |
<A extends org.uberfire.java.nio.file.attribute.BasicFileAttributes> |
readAttributes(org.uberfire.java.nio.file.Path path,
Class<A> type,
org.uberfire.java.nio.file.LinkOption... options) |
Map<String,Object> |
readAttributes(org.uberfire.java.nio.file.Path path,
String attributes,
org.uberfire.java.nio.file.LinkOption... options) |
org.uberfire.java.nio.file.Path |
readSymbolicLink(org.uberfire.java.nio.file.Path link) |
void |
rescanForExistingRepositories()
Forgets all existing registered filesystems and scans for existing git repositories under
gitReposParentDir. |
void |
setAttribute(org.uberfire.java.nio.file.Path path,
String attribute,
Object value,
org.uberfire.java.nio.file.LinkOption... options) |
void |
setAuthenticator(org.uberfire.java.nio.security.FileSystemAuthenticator authenticator) |
void |
setAuthorizer(org.uberfire.java.nio.security.FileSystemAuthorizer authorizer) |
void |
setDetectedFS(org.eclipse.jgit.util.FS detectedFS) |
void |
shutdown()
Closes and disposes all open filesystems and stops the Git and SSH daemons if they are running.
|
public static final String GIT_ENV_KEY_DEFAULT_REMOTE_NAME
public static final String GIT_DAEMON_ENABLED
public static final String GIT_SSH_ENABLED
public static final String GIT_NIO_DIR
public static final String GIT_NIO_DIR_NAME
public static final String GIT_ENV_KEY_LIST_MODE
ListBranchCommand.ListMode.public static final String GIT_ENV_KEY_DEST_PATH
public static final String GIT_ENV_KEY_USER_NAME
public static final String GIT_ENV_KEY_PASSWORD
public static final String GIT_ENV_KEY_INIT
public static final String REPOSITORIES_CONTAINER_DIR
public static final String SSH_FILE_CERT_CONTAINER_DIR
public static final String DEFAULT_HOST_NAME
public static final String DEFAULT_HOST_ADDR
public static final String DAEMON_DEFAULT_ENABLED
public static final String DAEMON_DEFAULT_PORT
public static final String SSH_DEFAULT_ENABLED
public static final String SSH_DEFAULT_PORT
public static final String SSH_IDLE_TIMEOUT
public static final String SSH_ALGORITHM
public static final String SSH_CERT_PASSPHRASE
public static final String DEFAULT_COMMIT_LIMIT_TO_GC
protected static final String DEFAULT_IO_SERVICE_NAME
public JGitFileSystemProvider()
public JGitFileSystemProvider(Map<String,String> gitPrefs)
public JGitFileSystemProvider(org.uberfire.commons.config.ConfigProperties gitPrefs)
public void onCloseFileSystem(JGitFileSystem fileSystem)
public void onDisposeFileSystem(JGitFileSystem fileSystem)
public Set<JGitFileSystem> getOpenFileSystems()
public void setAuthenticator(org.uberfire.java.nio.security.FileSystemAuthenticator authenticator)
setAuthenticator in interface org.uberfire.java.nio.security.SecuredFileSystemProviderpublic void setAuthorizer(org.uberfire.java.nio.security.FileSystemAuthorizer authorizer)
setAuthorizer in interface org.uberfire.java.nio.security.SecuredFileSystemProviderpublic void dispose()
dispose in interface org.uberfire.commons.lifecycle.Disposablepublic final void rescanForExistingRepositories()
gitReposParentDir. Call this method any time you add or remove git repositories without using this
class. If you only ever add or remove git repositories using the methods of this class, there is no need to call
this method.public void shutdown()
rescanForExistingRepositories().public File getGitRepoContainerDir()
public void forceAsDefault()
forceAsDefault in interface org.uberfire.java.nio.file.spi.FileSystemProviderpublic boolean isDefault()
isDefault in interface org.uberfire.java.nio.file.spi.FileSystemProviderpublic String getScheme()
getScheme in interface org.uberfire.java.nio.file.spi.FileSystemProviderpublic org.uberfire.java.nio.file.FileSystem newFileSystem(org.uberfire.java.nio.file.Path path,
Map<String,?> env)
throws IllegalArgumentException,
UnsupportedOperationException,
org.uberfire.java.nio.IOException,
SecurityException
newFileSystem in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic org.uberfire.java.nio.file.FileSystem newFileSystem(URI uri, Map<String,?> env) throws IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException, org.uberfire.java.nio.file.FileSystemAlreadyExistsException
newFileSystem in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionorg.uberfire.java.nio.file.FileSystemAlreadyExistsExceptionpublic org.uberfire.java.nio.file.FileSystem getFileSystem(URI uri) throws IllegalArgumentException, org.uberfire.java.nio.file.FileSystemNotFoundException, SecurityException
getFileSystem in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionorg.uberfire.java.nio.file.FileSystemNotFoundExceptionSecurityExceptionpublic org.uberfire.java.nio.file.Path getPath(URI uri) throws IllegalArgumentException, org.uberfire.java.nio.file.FileSystemNotFoundException, SecurityException
getPath in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionorg.uberfire.java.nio.file.FileSystemNotFoundExceptionSecurityExceptionpublic InputStream newInputStream(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.file.NoSuchFileException, org.uberfire.java.nio.IOException, SecurityException
newInputStream in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.file.NoSuchFileExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic OutputStream newOutputStream(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
newOutputStream in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic FileChannel newFileChannel(org.uberfire.java.nio.file.Path path, Set<? extends org.uberfire.java.nio.file.OpenOption> options, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
newFileChannel in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic org.uberfire.java.nio.channels.AsynchronousFileChannel newAsynchronousFileChannel(org.uberfire.java.nio.file.Path path,
Set<? extends org.uberfire.java.nio.file.OpenOption> options,
ExecutorService executor,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)
throws IllegalArgumentException,
UnsupportedOperationException,
org.uberfire.java.nio.IOException,
SecurityException
newAsynchronousFileChannel in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic org.uberfire.java.nio.channels.SeekableByteChannel newByteChannel(org.uberfire.java.nio.file.Path path,
Set<? extends org.uberfire.java.nio.file.OpenOption> options,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)
throws IllegalArgumentException,
UnsupportedOperationException,
org.uberfire.java.nio.file.FileAlreadyExistsException,
org.uberfire.java.nio.IOException,
SecurityException
newByteChannel in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionprotected boolean exists(org.uberfire.java.nio.file.Path path)
public org.uberfire.java.nio.file.DirectoryStream<org.uberfire.java.nio.file.Path> newDirectoryStream(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.DirectoryStream.Filter<org.uberfire.java.nio.file.Path> pfilter)
throws org.uberfire.java.nio.file.NotDirectoryException,
org.uberfire.java.nio.IOException,
SecurityException
newDirectoryStream in interface org.uberfire.java.nio.file.spi.FileSystemProviderorg.uberfire.java.nio.file.NotDirectoryExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void createDirectory(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)
throws UnsupportedOperationException,
org.uberfire.java.nio.file.FileAlreadyExistsException,
org.uberfire.java.nio.IOException,
SecurityException
createDirectory in interface org.uberfire.java.nio.file.spi.FileSystemProviderUnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void createSymbolicLink(org.uberfire.java.nio.file.Path link,
org.uberfire.java.nio.file.Path target,
org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)
throws UnsupportedOperationException,
org.uberfire.java.nio.file.FileAlreadyExistsException,
org.uberfire.java.nio.IOException,
SecurityException
createSymbolicLink in interface org.uberfire.java.nio.file.spi.FileSystemProviderUnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void createLink(org.uberfire.java.nio.file.Path link,
org.uberfire.java.nio.file.Path existing)
throws UnsupportedOperationException,
org.uberfire.java.nio.file.FileAlreadyExistsException,
org.uberfire.java.nio.IOException,
SecurityException
createLink in interface org.uberfire.java.nio.file.spi.FileSystemProviderUnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void delete(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.DeleteOption... options)
throws org.uberfire.java.nio.file.DirectoryNotEmptyException,
org.uberfire.java.nio.file.NoSuchFileException,
org.uberfire.java.nio.IOException,
SecurityException
delete in interface org.uberfire.java.nio.file.spi.FileSystemProviderorg.uberfire.java.nio.file.DirectoryNotEmptyExceptionorg.uberfire.java.nio.file.NoSuchFileExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void deleteAsset(JGitPathImpl path, org.uberfire.java.nio.file.DeleteOption... options)
public void deleteBranch(JGitPathImpl path)
public boolean deleteIfExists(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.DeleteOption... options)
throws org.uberfire.java.nio.file.DirectoryNotEmptyException,
org.uberfire.java.nio.IOException,
SecurityException
deleteIfExists in interface org.uberfire.java.nio.file.spi.FileSystemProviderorg.uberfire.java.nio.file.DirectoryNotEmptyExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic boolean deleteBranchIfExists(JGitPathImpl path)
public boolean deleteAssetIfExists(JGitPathImpl path, org.uberfire.java.nio.file.DeleteOption... options)
public org.uberfire.java.nio.file.Path readSymbolicLink(org.uberfire.java.nio.file.Path link)
throws UnsupportedOperationException,
org.uberfire.java.nio.file.NotLinkException,
org.uberfire.java.nio.IOException,
SecurityException
readSymbolicLink in interface org.uberfire.java.nio.file.spi.FileSystemProviderUnsupportedOperationExceptionorg.uberfire.java.nio.file.NotLinkExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void copy(org.uberfire.java.nio.file.Path source,
org.uberfire.java.nio.file.Path target,
org.uberfire.java.nio.file.CopyOption... options)
throws UnsupportedOperationException,
org.uberfire.java.nio.file.FileAlreadyExistsException,
org.uberfire.java.nio.file.DirectoryNotEmptyException,
org.uberfire.java.nio.IOException,
SecurityException
copy in interface org.uberfire.java.nio.file.spi.FileSystemProviderUnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.file.DirectoryNotEmptyExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void move(org.uberfire.java.nio.file.Path source,
org.uberfire.java.nio.file.Path target,
org.uberfire.java.nio.file.CopyOption... options)
throws org.uberfire.java.nio.file.DirectoryNotEmptyException,
org.uberfire.java.nio.file.AtomicMoveNotSupportedException,
org.uberfire.java.nio.IOException,
SecurityException
move in interface org.uberfire.java.nio.file.spi.FileSystemProviderorg.uberfire.java.nio.file.DirectoryNotEmptyExceptionorg.uberfire.java.nio.file.AtomicMoveNotSupportedExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic boolean isSameFile(org.uberfire.java.nio.file.Path pathA,
org.uberfire.java.nio.file.Path pathB)
throws org.uberfire.java.nio.IOException,
SecurityException
isSameFile in interface org.uberfire.java.nio.file.spi.FileSystemProviderorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic boolean isHidden(org.uberfire.java.nio.file.Path path)
throws IllegalArgumentException,
org.uberfire.java.nio.IOException,
SecurityException
isHidden in interface org.uberfire.java.nio.file.spi.FileSystemProviderIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic org.uberfire.java.nio.file.FileStore getFileStore(org.uberfire.java.nio.file.Path path)
throws org.uberfire.java.nio.IOException,
SecurityException
getFileStore in interface org.uberfire.java.nio.file.spi.FileSystemProviderorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void checkAccess(org.uberfire.java.nio.file.Path path,
org.uberfire.java.nio.file.AccessMode... modes)
throws UnsupportedOperationException,
org.uberfire.java.nio.file.NoSuchFileException,
org.uberfire.java.nio.file.AccessDeniedException,
org.uberfire.java.nio.IOException,
SecurityException
checkAccess in interface org.uberfire.java.nio.file.spi.FileSystemProviderUnsupportedOperationExceptionorg.uberfire.java.nio.file.NoSuchFileExceptionorg.uberfire.java.nio.file.AccessDeniedExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic <V extends org.uberfire.java.nio.file.attribute.FileAttributeView> V getFileAttributeView(org.uberfire.java.nio.file.Path path,
Class<V> type,
org.uberfire.java.nio.file.LinkOption... options)
throws org.uberfire.java.nio.file.NoSuchFileException
getFileAttributeView in interface org.uberfire.java.nio.file.spi.FileSystemProviderorg.uberfire.java.nio.file.NoSuchFileExceptionpublic <A extends org.uberfire.java.nio.file.attribute.BasicFileAttributes> A readAttributes(org.uberfire.java.nio.file.Path path,
Class<A> type,
org.uberfire.java.nio.file.LinkOption... options)
throws org.uberfire.java.nio.file.NoSuchFileException,
UnsupportedOperationException,
org.uberfire.java.nio.IOException,
SecurityException
readAttributes in interface org.uberfire.java.nio.file.spi.FileSystemProviderorg.uberfire.java.nio.file.NoSuchFileExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic Map<String,Object> readAttributes(org.uberfire.java.nio.file.Path path, String attributes, org.uberfire.java.nio.file.LinkOption... options) throws UnsupportedOperationException, IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException
readAttributes in interface org.uberfire.java.nio.file.spi.FileSystemProviderUnsupportedOperationExceptionIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void setAttribute(org.uberfire.java.nio.file.Path path,
String attribute,
Object value,
org.uberfire.java.nio.file.LinkOption... options)
throws UnsupportedOperationException,
IllegalArgumentException,
ClassCastException,
org.uberfire.java.nio.IOException,
SecurityException
setAttribute in interface org.uberfire.java.nio.file.spi.FileSystemProviderUnsupportedOperationExceptionIllegalArgumentExceptionClassCastExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionpublic void setDetectedFS(org.eclipse.jgit.util.FS detectedFS)
Copyright © 2012–2017 JBoss by Red Hat. All rights reserved.