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

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

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

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

@Override
public void move( final Path source,
         final Path target,
         final CopyOption... options )
    throws DirectoryNotEmptyException, AtomicMoveNotSupportedException, IOException, SecurityException {
  checkNotNull( "source", source );
  checkNotNull( "target", target );
  try {
    copy( source, target, options );
    delete( source );
  } catch ( final Exception ex ) {
    throw new IOException( ex );
  }
}
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

final Path target = PROVIDER.getPath( URI.create( "git://other_branch@copybranch-test-repo" ) );
PROVIDER.copy( source, target );
  PROVIDER.copy( source, target );
  failBecauseExceptionWasNotThrown( FileAlreadyExistsException.class );
} catch ( FileAlreadyExistsException e ) {
  PROVIDER.copy( notExists, notExists2 );
  failBecauseExceptionWasNotThrown( NoSuchFileException.class );
} catch ( NoSuchFileException e ) {
origin: org.kie.commons/kie-nio2-jgit

final Path target = PROVIDER.getPath( URI.create( "git://master@copydir-test-repo/" ) );
PROVIDER.copy( source, target );
final Path target = PROVIDER.getPath( URI.create( "git://master@copydir-test-repo/some/place/here/" ) );
PROVIDER.copy( source, target );
final Path target = PROVIDER.getPath( URI.create( "git://master@copydir-test-repo/soXme/place/here" ) );
PROVIDER.copy( source, target );
final Path target = PROVIDER.getPath( URI.create( "git://master@copydir-test-repo/other_here/" ) );
PROVIDER.copy( source, target );
  PROVIDER.copy( source, target );
  failBecauseExceptionWasNotThrown( NoSuchFileException.class );
} catch ( NoSuchFileException e ) {
  PROVIDER.copy( source, target );
  failBecauseExceptionWasNotThrown( FileAlreadyExistsException.class );
} catch ( FileAlreadyExistsException e ) {
org.kie.commons.java.nio.fs.jgitJGitFileSystemProvidercopy

Popular methods of JGitFileSystemProvider

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

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Option (scala)
  • Top Sublime Text 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