Codota Logo
JGitFileSystemProvider.newDirectoryStream
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: org.kie.commons/kie-nio2-jgit

private void copyDirectory( final JGitPathImpl source,
              final JGitPathImpl target,
              final CopyOption... options ) {
  final List<JGitPathImpl> directories = new ArrayList<JGitPathImpl>();
  for ( final Path path : newDirectoryStream( source, null ) ) {
    final JGitPathImpl gPath = toPathImpl( path );
    final Pair<PathType, ObjectId> pathResult = checkPath( gPath.getFileSystem().gitRepo(), gPath.getRefTree(), gPath.getPath() );
    if ( pathResult.getK1() == DIRECTORY ) {
      directories.add( gPath );
      continue;
    }
    final JGitPathImpl gTarget = composePath( target, (JGitPathImpl) gPath.getFileName() );
    copyFile( gPath, gTarget );
  }
  for ( final JGitPathImpl directory : directories ) {
    createDirectory( composePath( target, (JGitPathImpl) directory.getFileName() ) );
  }
}
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testCopyFiles() throws IOException {
  final URI newRepo = URI.create( "git://copyasset-test-repo" );
  PROVIDER.newFileSystem( newRepo, EMPTY_ENV );
  final Path path = PROVIDER.getPath( URI.create( "git://master@copyasset-test-repo/myfile1.txt" ) );
  {
    final OutputStream outStream = PROVIDER.newOutputStream( path );
    outStream.write( "my cool content".getBytes() );
    outStream.close();
  }
  final Path path2 = PROVIDER.getPath( URI.create( "git://user_branch@copyasset-test-repo/other/path/myfile2.txt" ) );
  {
    final OutputStream outStream2 = PROVIDER.newOutputStream( path2 );
    outStream2.write( "my cool content".getBytes() );
    outStream2.close();
  }
  final Path path3 = PROVIDER.getPath( URI.create( "git://user_branch@copyasset-test-repo/myfile3.txt" ) );
  {
    final OutputStream outStream3 = PROVIDER.newOutputStream( path3 );
    outStream3.write( "my cool content".getBytes() );
    outStream3.close();
  }
  final Path target = PROVIDER.getPath( URI.create( "git://user_branch@copyasset-test-repo/myfile1.txt" ) );
  PROVIDER.copy( path, target );
  final DirectoryStream<Path> stream = PROVIDER.newDirectoryStream( PROVIDER.getPath( URI.create( "git://user_branch@copyasset-test-repo/" ) ), null );
  for ( Path path1 : stream ) {
    System.out.println("content: " + path1.toUri());
  }
  assertThat( stream ).isNotNull().hasSize( 3 );
}
origin: org.kie.commons/kie-nio2-jgit

outStream4.close();
final DirectoryStream<Path> stream1 = PROVIDER.newDirectoryStream( PROVIDER.getPath( URI.create( "git://user_branch@filter-dirstream-test-repo/" ) ), new DirectoryStream.Filter<Path>() {
  @Override
  public boolean accept( final Path entry ) throws org.kie.commons.java.nio.IOException {
final DirectoryStream<Path> stream2 = PROVIDER.newDirectoryStream( PROVIDER.getPath( URI.create( "git://master@filter-dirstream-test-repo/" ) ), new DirectoryStream.Filter<Path>() {
  @Override
  public boolean accept( final Path entry ) throws org.kie.commons.java.nio.IOException {
origin: org.kie.commons/kie-nio2-jgit

outStream3.close();
final DirectoryStream<Path> stream1 = PROVIDER.newDirectoryStream( PROVIDER.getPath( URI.create( "git://user_branch@dirstream-test-repo/" ) ), null );
final DirectoryStream<Path> stream2 = PROVIDER.newDirectoryStream( PROVIDER.getPath( URI.create( "git://user_branch@dirstream-test-repo/other" ) ), null );
final DirectoryStream<Path> stream3 = PROVIDER.newDirectoryStream( PROVIDER.getPath( URI.create( "git://user_branch@dirstream-test-repo/other/path" ) ), null );
final DirectoryStream<Path> stream4 = PROVIDER.newDirectoryStream( PROVIDER.getPath( URI.create( "git://master@dirstream-test-repo/" ) ), null );
  PROVIDER.newDirectoryStream( path, null );
  failBecauseExceptionWasNotThrown( NotDirectoryException.class );
} catch ( NotDirectoryException ex ) {
  PROVIDER.newDirectoryStream( crazyPath, null );
  failBecauseExceptionWasNotThrown( NotDirectoryException.class );
} catch ( NotDirectoryException ex ) {
assertThat( PROVIDER.newDirectoryStream( crazyPath, null ) ).isNotNull().hasSize( 1 );
origin: org.kie.commons/kie-nio2-jgit

final DirectoryStream<Path> stream3 = PROVIDER.newDirectoryStream( dir, null );
origin: org.kie.commons/kie-nio2-jgit

final DirectoryStream<Path> stream = PROVIDER.newDirectoryStream( PROVIDER.getPath( URI.create( "git://other_branch@copybranch-test-repo/" ) ), null );
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testNewFileSystem() {
  final URI newRepo = URI.create( "git://repo-name" );
  final FileSystem fs = PROVIDER.newFileSystem( newRepo, EMPTY_ENV );
  assertThat( fs ).isNotNull();
  final DirectoryStream<Path> stream = PROVIDER.newDirectoryStream( PROVIDER.getPath( newRepo ), null );
  assertThat( stream ).isNotNull().hasSize( 0 );
  try {
    PROVIDER.newFileSystem( newRepo, EMPTY_ENV );
    failBecauseExceptionWasNotThrown( FileSystemAlreadyExistsException.class );
  } catch ( final Exception ex ) {
  }
  PROVIDER.newFileSystem( URI.create( "git://repo-name2" ), EMPTY_ENV );
}
origin: org.kie.commons/kie-nio2-jgit

@Test
public void testNewFileSystemInited() {
  final URI newRepo = URI.create( "git://init-repo-name" );
  final Map<String, ?> env = new HashMap<String, Object>() {{
    put( "init", Boolean.TRUE );
  }};
  final FileSystem fs = PROVIDER.newFileSystem( newRepo, env );
  assertThat( fs ).isNotNull();
  final DirectoryStream<Path> stream = PROVIDER.newDirectoryStream( PROVIDER.getPath( newRepo ), null );
  assertThat( stream ).isNotNull().hasSize( 1 );
}
origin: org.kie.commons/kie-nio2-jgit

final DirectoryStream<Path> stream = PROVIDER.newDirectoryStream( target, null );
final DirectoryStream<Path> stream = PROVIDER.newDirectoryStream( target, null );
final DirectoryStream<Path> stream = PROVIDER.newDirectoryStream( target, null );
final DirectoryStream<Path> stream = PROVIDER.newDirectoryStream( target, null );
origin: org.kie.commons/kie-nio2-jgit

  assertThat( PROVIDER.newDirectoryStream( root, null ) ).isNotEmpty().hasSize( 2 );
} else if ( root.toAbsolutePath().toUri().toString().contains( "origin" ) ) {
  assertThat( PROVIDER.newDirectoryStream( root, null ) ).isNotEmpty().hasSize( 1 );
} else {
  assertThat( PROVIDER.newDirectoryStream( root, null ) ).isNotEmpty().hasSize( 2 );
  assertThat( PROVIDER.newDirectoryStream( root, null ) ).isNotEmpty().hasSize( 3 );
} else if ( root.toAbsolutePath().toUri().toString().contains( "origin" ) ) {
  assertThat( PROVIDER.newDirectoryStream( root, null ) ).isNotEmpty().hasSize( 1 );
} else {
  assertThat( PROVIDER.newDirectoryStream( root, null ) ).isNotEmpty().hasSize( 3 );
org.kie.commons.java.nio.fs.jgitJGitFileSystemProvidernewDirectoryStream

Popular methods of JGitFileSystemProvider

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

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • JFrame (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now