Tabnine Logo
JGitFileSystemProvider.getScheme
Code IndexAdd Tabnine to your IDE (free)

How to use
getScheme
method
in
org.kie.commons.java.nio.fs.jgit.JGitFileSystemProvider

Best Java code snippets using org.kie.commons.java.nio.fs.jgit.JGitFileSystemProvider.getScheme (Showing top 9 results out of 315)

origin: org.kie.commons/kie-nio2-jgit

@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;
  }
}
origin: org.kie.commons/kie-nio2-jgit

  throws IllegalArgumentException, IOException, SecurityException, FileSystemAlreadyExistsException {
checkNotNull( "uri", uri );
checkCondition( "uri scheme not supported", uri.getScheme().equals( getScheme() ) || uri.getScheme().equals( "default" ) );
checkURI( "uri", uri );
checkNotNull( "env", env );
    final URI initURI = URI.create( getScheme() + "://master@" + name + "/readme.md" );
    final CommentedOption op = setupOp( env );
    final OutputStream stream = newOutputStream( getPath( initURI ), op );
origin: org.kie.commons/kie-nio2-jgit

@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;
}
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testPathBranchRooted() throws IOException, GitAPIException {
  final JGitFileSystemProvider fsProvider = mock( JGitFileSystemProvider.class );
  when( fsProvider.isDefault() ).thenReturn( false );
  when( fsProvider.getScheme() ).thenReturn( "git" );
  final Git git = setupGit();
  final JGitFileSystem fileSystem = new JGitFileSystem( fsProvider, null, git, "my-repo", CredentialsProvider.getDefault() );
  final Path path = fileSystem.getPath( "test-branch", "/path/to/some/place.txt" );
  assertThat( path ).isNotNull();
  assertThat( path.isAbsolute() ).isTrue();
  assertThat( path.toString() ).isEqualTo( "/path/to/some/place.txt" );
  assertThat( path.toUri().toString() ).isEqualTo( "git://test-branch@my-repo/path/to/some/place.txt" );
  assertThat( path.getNameCount() ).isEqualTo( 4 );
  assertThat( path.getName( 0 ).toString() ).isNotNull().isEqualTo( "path" );
  assertThat( path.getRoot().toString() ).isNotNull().isEqualTo( "/" );
}
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testPathBranchRooted2() throws IOException, GitAPIException {
  final JGitFileSystemProvider fsProvider = mock( JGitFileSystemProvider.class );
  when( fsProvider.isDefault() ).thenReturn( false );
  when( fsProvider.getScheme() ).thenReturn( "git" );
  final Git git = setupGit();
  final JGitFileSystem fileSystem = new JGitFileSystem( fsProvider, null, git, "my-repo", CredentialsProvider.getDefault() );
  final Path path = fileSystem.getPath( "test-branch", "/path/to", "some/place.txt" );
  assertThat( path ).isNotNull();
  assertThat( path.isAbsolute() ).isTrue();
  assertThat( path.toString() ).isEqualTo( "/path/to/some/place.txt" );
  assertThat( path.toUri().toString() ).isEqualTo( "git://test-branch@my-repo/path/to/some/place.txt" );
  assertThat( path.getNameCount() ).isEqualTo( 4 );
  assertThat( path.getName( 0 ).toString() ).isNotNull().isEqualTo( "path" );
  assertThat( path.getRoot().toString() ).isNotNull().isEqualTo( "/" );
}
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testPathBranchNonRooted2() throws IOException, GitAPIException {
  final JGitFileSystemProvider fsProvider = mock( JGitFileSystemProvider.class );
  when( fsProvider.isDefault() ).thenReturn( false );
  when( fsProvider.getScheme() ).thenReturn( "git" );
  final Git git = setupGit();
  final JGitFileSystem fileSystem = new JGitFileSystem( fsProvider, null, git, "my-repo", CredentialsProvider.getDefault() );
  final Path path = fileSystem.getPath( "test-branch", "path/to", "some/place.txt" );
  assertThat( path ).isNotNull();
  assertThat( path.isAbsolute() ).isFalse();
  assertThat( path.toString() ).isEqualTo( "path/to/some/place.txt" );
  assertThat( path.toUri().toString() ).isEqualTo( "git://test-branch@my-repo/:path/to/some/place.txt" );
  assertThat( path.getNameCount() ).isEqualTo( 4 );
  assertThat( path.getName( 0 ).toString() ).isNotNull().isEqualTo( "path" );
  assertThat( path.getRoot().toString() ).isNotNull().isEqualTo( "" );
}
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testPathNonBranchRooted() throws IOException, GitAPIException {
  final JGitFileSystemProvider fsProvider = mock( JGitFileSystemProvider.class );
  when( fsProvider.isDefault() ).thenReturn( false );
  when( fsProvider.getScheme() ).thenReturn( "git" );
  final Git git = setupGit();
  final JGitFileSystem fileSystem = new JGitFileSystem( fsProvider, null, git, "my-repo", CredentialsProvider.getDefault() );
  final Path path = fileSystem.getPath( "/path/to/some/place.txt" );
  assertThat( path ).isNotNull();
  assertThat( path.isAbsolute() ).isTrue();
  assertThat( path.toString() ).isEqualTo( "/path/to/some/place.txt" );
  assertThat( path.toUri().toString() ).isEqualTo( "git://master@my-repo/path/to/some/place.txt" );
  assertThat( path.getNameCount() ).isEqualTo( 4 );
  assertThat( path.getName( 0 ).toString() ).isNotNull().isEqualTo( "path" );
  assertThat( path.getRoot().toString() ).isNotNull().isEqualTo( "/" );
}
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testPathNonBranchNonRooted() throws IOException, GitAPIException {
  final JGitFileSystemProvider fsProvider = mock( JGitFileSystemProvider.class );
  when( fsProvider.isDefault() ).thenReturn( false );
  when( fsProvider.getScheme() ).thenReturn( "git" );
  final Git git = setupGit();
  final JGitFileSystem fileSystem = new JGitFileSystem( fsProvider, null, git, "my-repo", CredentialsProvider.getDefault() );
  final Path path = fileSystem.getPath( "path/to/some/place.txt" );
  assertThat( path ).isNotNull();
  assertThat( path.isAbsolute() ).isFalse();
  assertThat( path.toString() ).isEqualTo( "path/to/some/place.txt" );
  assertThat( path.toUri().toString() ).isEqualTo( "git://master@my-repo/:path/to/some/place.txt" );
  assertThat( path.getNameCount() ).isEqualTo( 4 );
  assertThat( path.getName( 0 ).toString() ).isNotNull().isEqualTo( "path" );
  assertThat( path.getRoot().toString() ).isNotNull().isEqualTo( "" );
}
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testPathBranchNonRooted() throws IOException, GitAPIException {
  final JGitFileSystemProvider fsProvider = mock( JGitFileSystemProvider.class );
  when( fsProvider.isDefault() ).thenReturn( false );
  when( fsProvider.getScheme() ).thenReturn( "git" );
  final Git git = setupGit();
  final JGitFileSystem fileSystem = new JGitFileSystem( fsProvider, null, git, "my-repo", CredentialsProvider.getDefault() );
  final Path path = fileSystem.getPath( "test-branch", "path/to/some/place.txt" );
  assertThat( path ).isNotNull();
  assertThat( path.isAbsolute() ).isFalse();
  assertThat( path.toString() ).isEqualTo( "path/to/some/place.txt" );
  assertThat( path.toUri().toString() ).isEqualTo( "git://test-branch@my-repo/:path/to/some/place.txt" );
  assertThat( path.getNameCount() ).isEqualTo( 4 );
  assertThat( path.getName( 0 ).toString() ).isNotNull().isEqualTo( "path" );
  assertThat( path.getRoot().toString() ).isNotNull().isEqualTo( "" );
}
org.kie.commons.java.nio.fs.jgitJGitFileSystemProvidergetScheme

Popular methods of JGitFileSystemProvider

  • copy
  • createDirectory
  • delete
  • deleteIfExists
  • exists
  • getFileAttributeView
  • getPath
  • newDirectoryStream
  • newInputStream
  • newOutputStream
  • readAttributes
  • <init>
  • readAttributes,
  • <init>,
  • amend,
  • buildAndStartDaemon,
  • buildCredential,
  • checkAccess,
  • checkAmend,
  • checkURI,
  • composePath

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JButton (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now