private static FileSystemProvider getProvider(final String scheme) throws FileSystemNotFoundException, ServiceConfigurationError { checkNotEmpty("scheme", scheme); final FileSystemProvider fileSystemProvider = FileSystemProvidersHolder.mapOfinstalledProviders.get(scheme); if (fileSystemProvider == null) { throw new FileSystemNotFoundException("Provider '" + scheme + "' not found"); } return fileSystemProvider; }
ErrorPopup.showMessage( CommonConstants.INSTANCE.ExceptionGeneric0( e.getMessage() ) );
@Override public Path getPath( final URI uri ) throws IllegalArgumentException, FileSystemNotFoundException, SecurityException { checkNotNull( "uri", uri ); checkCondition( "uri scheme not supported", uri.getScheme().equals( getScheme() ) || uri.getScheme().equals( "default" ) ); checkURI( "uri", uri ); final JGitFileSystem fileSystem = fileSystems.get( extractRepoName( uri ) ); if ( fileSystem == null ) { throw new FileSystemNotFoundException(); } try { return JGitPathImpl.create( fileSystem, URIUtil.decode( extractPath( uri ) ), extractHost( uri ), false ); } catch ( final URIException e ) { return null; } }
@Override public FileSystem getFileSystem( final URI uri ) throws IllegalArgumentException, FileSystemNotFoundException, SecurityException { checkNotNull( "uri", uri ); checkCondition( "uri scheme not supported", uri.getScheme().equals( getScheme() ) || uri.getScheme().equals( "default" ) ); checkURI( "uri", uri ); final JGitFileSystem fileSystem = fileSystems.get( extractRepoName( uri ) ); if ( fileSystem == null ) { throw new FileSystemNotFoundException( "No filesystem for uri (" + uri + ") found." ); } if ( hasSyncFlag( uri ) ) { try { final String treeRef = "master"; final ObjectId oldHead = JGitUtil.getTreeRefObjectId( fileSystem.gitRepo().getRepository(), treeRef ); final Map<String, String> params = getQueryParams( uri ); syncRepository( fileSystem.gitRepo(), fileSystem.getCredential(), params.get( "sync" ), hasForceFlag( uri ) ); final ObjectId newHead = JGitUtil.getTreeRefObjectId( fileSystem.gitRepo().getRepository(), treeRef ); notifyDiffs( fileSystem, treeRef, "<system>", "<system>", oldHead, newHead ); } catch ( final Exception ex ) { throw new IOException( ex ); } } return fileSystem; }