org.kie.commons.java.nio.file.Path.resolveSibling()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.kie.commons.java.nio.file.Path.resolveSibling()方法的一些代码示例,展示了Path.resolveSibling()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.resolveSibling()方法的具体详情如下:
包路径:org.kie.commons.java.nio.file.Path
类名称:Path
方法名:resolveSibling

Path.resolveSibling介绍

暂无

代码示例

代码示例来源:origin: org.kie.commons/kie-nio2-model

public static Path dot( final Path path ) {
  if ( path.getFileName() == null ) {
    return path.resolve( ".root" );
  }
  return path.resolveSibling( "." + path.getFileName() );
}

代码示例来源:origin: org.kie.commons/kie-commons-io

@Test(expected = NoSuchFileException.class)
  public void readAttributesNoSuchFileException() {
    final Path path = getDirectoryPath().resolveSibling( "somethingXXX" );

    ioService().deleteIfExists( path );

    ioService().readAttributes( path );
  }
}

代码示例来源:origin: org.kie.commons/kie-commons-io

@Test(expected = FileAlreadyExistsException.class)
public void createDirectoryFileAlreadyExistsException() {
  final Path path = getDirectoryPath().resolveSibling( "otherDir" );
  ioService().deleteIfExists( path );
  ioService().createDirectory( path );
  ioService().createDirectory( path );
}

代码示例来源:origin: org.kie.commons/kie-commons-io

@Test(expected = FileAlreadyExistsException.class)
public void newByteChannelFileAlreadyExistsException() {
  final Path path = getFilePath().resolveSibling( "alreadyExists.txt" );
  ioService().deleteIfExists( path );
  ioService().write( path, "ooooo!" );
  ioService().newByteChannel( path );
}

代码示例来源:origin: org.kie.commons/kie-commons-io

@Test(expected = DirectoryNotEmptyException.class)
public void deleteIfExistsDirectoryNotEmptyException() {
  final Path path = getDirectoryPath().resolveSibling( "dirToBugIfExists" );
  ioService().createDirectories( path );
  ioService().write( path.resolve( "myFile.txt" ), "ooooo!" );
  ioService().deleteIfExists( path );
}

代码示例来源:origin: org.kie.commons/kie-commons-io

@Test(expected = FileAlreadyExistsException.class)
public void createDirectoriesFileAlreadyExistsException() {
  final Path path = getDirectoryPath().resolveSibling( "otherDir" ).resolve( "innerDir" );
  ioService().deleteIfExists( path );
  ioService().createDirectories( path );
  ioService().createDirectories( path );
}

代码示例来源:origin: org.kie.commons/kie-commons-io

@Test(expected = DirectoryNotEmptyException.class)
public void deleteDirectoryNotEmptyException() {
  final Path path = getDirectoryPath().resolveSibling( "dirToBug" );
  ioService().createDirectories( path );
  ioService().write( path.resolve( "myFile.txt" ), "ooooo!" );
  ioService().delete( path );
}

代码示例来源:origin: org.kie.commons/kieora-commons-io

@Test
public void testIndexedFile() throws IOException {
  final Path path = getDirectoryPath().resolveSibling( "someNewOtherPath" ).resolve( "myIndexedFile.txt" );
  ioService().write( path, "ooooo!", Collections.<OpenOption>emptySet(), new FileAttribute<Object>() {
              @Override
  assertTrue( metaModelStore.getMetaObject( Path.class.getName() ).getProperty( "my_new_key" ).getTypes().contains( String.class ) );
  ioService().write( path.resolveSibling( "otherIndexedFile.txt" ), "ooooo!", Collections.<OpenOption>emptySet(), new FileAttribute<Object>() {
              @Override
              public String name() {

代码示例来源:origin: org.kie.commons/kieora-commons-io

@Test
public void testIndexedFile() throws IOException {
  final Path dir = ioService().createDirectories( getDirectoryPath().resolveSibling( "someNewOtherPath" ) );
  assertTrue( metaModelStore.getMetaObject( Path.class.getName() ).getProperty( "my_new_key" ).getTypes().contains( String.class ) );
  ioService().write( path.resolveSibling( "otherIndexedFile.txt" ), "ooooo!", Collections.<OpenOption>emptySet(), new FileAttribute<Object>() {
              @Override
              public String name() {

代码示例来源:origin: org.kie.commons/kie-commons-io

@Test(expected = FileAlreadyExistsException.class)
public void copyFileAlreadyExistsException() {
  final Path path = getDirectoryPath().resolveSibling( "alreadyExistsTest" );
  ioService().deleteIfExists( path );
  ioService().createDirectories( path );
  ioService().write( path.resolve( "myFile.txt" ), "ooooo!" );
  ioService().write( path.resolve( "mytarget" ), "xooooo!" );
  ioService().copy( path.resolve( "myFile.txt" ), path.resolve( "mytarget" ) );
}

相关文章