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

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

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

Path.getFileName介绍

暂无

代码示例

代码示例来源:origin: org.kie.guvnor/guvnor-core-services-backend

@Override
//Don't process MetaData files
public boolean accept( final Path path ) {
  final String fileName = path.getFileName().toString();
  return !fileName.startsWith( "." );
}

代码示例来源:origin: org.kie.guvnor/guvnor-core-services-backend

@Override
public boolean accept( final Path path ) {
  if ( path.getFileName().toString().startsWith( "." ) ) {
    return false;
  }
  if ( next != null ) {
    return next.accept( path );
  }
  return true;
}

代码示例来源: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.guvnor/guvnor-core-services-backend

@Override
public boolean accept( final Path path ) {
  if ( path.getFileName().toString().equalsIgnoreCase( "META-INF" ) ) {
    return false;
  }
  if ( next != null ) {
    return next.accept( path );
  }
  return true;
}

代码示例来源:origin: org.kie.guvnor/guvnor-inbox-backend

public String[] listUsers() {
  //TODO: a temporary hack to retrieve user list. Please refactor later.
  List<String> userList = new ArrayList<String>();
  org.kie.commons.java.nio.file.Path userRoot = bootstrapRoot.resolve( "/.metadata/.users/" );
  final Iterator<org.kie.commons.java.nio.file.Path> userIterator = userRoot.iterator();
  if ( userIterator.hasNext() ) {
    org.kie.commons.java.nio.file.Path userDir = userIterator.next();
    userList.add( userDir.getFileName().toString() );
  }
  String[] result = new String[ userList.size() ];
  return userList.toArray( result );
}

代码示例来源:origin: org.kie.guvnor/guvnor-explorer-backend

public List<BreadCrumb> makeBreadCrumbs( final Path path,
                     final List<org.kie.commons.java.nio.file.Path> exclusions,
                     final Map<org.kie.commons.java.nio.file.Path, String> captionSubstitutions ) {
  final List<BreadCrumb> breadCrumbs = new ArrayList<BreadCrumb>();
  org.kie.commons.java.nio.file.Path nioPath = paths.convert( path );
  org.kie.commons.java.nio.file.Path nioFileName = nioPath.getFileName();
  while ( nioFileName != null ) {
    if ( includePath( nioPath,
             exclusions ) ) {
      String caption = nioFileName.toString();
      if ( captionSubstitutions.containsKey( nioPath ) ) {
        caption = captionSubstitutions.get( nioPath );
      }
      final BreadCrumb breadCrumb = new BreadCrumb( paths.convert( nioPath ),
                             caption );
      breadCrumbs.add( 0,
               breadCrumb );
    }
    nioPath = nioPath.getParent();
    nioFileName = nioPath.getFileName();
  }
  breadCrumbs.add( 0, new BreadCrumb( paths.convert( nioPath ),
                    getRootDirectory( nioPath ) ) );
  return breadCrumbs;
}

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

@Override
public boolean isHidden( final Path path )
    throws IllegalArgumentException, IOException, SecurityException {
  checkNotNull( "path", path );
  final JGitPathImpl gPath = toPathImpl( path );
  if ( gPath.getFileName() == null ) {
    return false;
  }
  return toPathImpl( path.getFileName() ).toString( false ).startsWith( "." );
}

代码示例来源:origin: org.jbpm/droolsjbpm-knowledge-services

if(availableForms != null){
  for (Path p : availableForms) {
    if (p.getFileName().toString().contains(processId)) {
      selectedForm = p;

代码示例来源:origin: org.jbpm/droolsjbpm-knowledge-services

if(availableForms != null){
  for (Path p : availableForms) {
    if (p.getFileName().toString().contains(task.getNames().get(0).getText())) {
      selectedForm = p;

代码示例来源:origin: org.kie.guvnor/guvnor-explorer-backend

final String projectName = pRoot.getFileName().toString();
if ( Files.exists( pomPath ) ) {
  items.add( new FileItem( paths.convert( pomPath ),

代码示例来源:origin: org.kie.guvnor/guvnor-project-backend

return paths.convert( path );
while ( path.getNameCount() > 0 && !path.getFileName().toString().equals( SOURCE_FILENAME ) ) {
  path = path.getParent();

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-project-backend

return makeProject( path );
while ( path.getNameCount() > 0 && !path.getFileName().toString().equals( SOURCE_FILENAME ) ) {
  path = path.getParent();

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

@Test
public void createDirectories() {
  final Path dir = getComposedDirectoryPath();
  assertFalse( ioService().exists( dir ) );
  ioService().createDirectories( dir, new FileAttribute<Object>() {
    @Override
    public String name() {
      return "custom";
    }
    @Override
    public Object value() {
      return dateValue;
    }
  } );
  assertTrue( ioService().exists( dir ) );
  assertTrue( ioService().exists( dir.getParent() ) );
  assertNotNull( ioService().exists( dir.getParent().getFileName() ) );
  Map<String, Object> attrs = ioService().readAttributes( dir );
  assertEquals( createDirectoriesAttrSize(), attrs.size() );
  ioService().delete( dir );
  ioService().exists( dir.getParent() );
}

相关文章