@Override //Don't process MetaData files public boolean accept( final Path path ) { final String fileName = path.getFileName().toString(); return !fileName.startsWith( "." ); }
@Override public boolean accept( final Path path ) { if ( path.getFileName().toString().startsWith( "." ) ) { return false; } if ( next != null ) { return next.accept( path ); } return true; }
public static Path dot( final Path path ) { if ( path.getFileName() == null ) { return path.resolve( ".root" ); } return path.resolveSibling( "." + path.getFileName() ); }
@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; }
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 ); }
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; }
@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( "." ); }
if(availableForms != null){ for (Path p : availableForms) { if (p.getFileName().toString().contains(processId)) { selectedForm = p;
if(availableForms != null){ for (Path p : availableForms) { if (p.getFileName().toString().contains(task.getNames().get(0).getText())) { selectedForm = p;
final String projectName = pRoot.getFileName().toString(); if ( Files.exists( pomPath ) ) { items.add( new FileItem( paths.convert( pomPath ),
return paths.convert( path ); while ( path.getNameCount() > 0 && !path.getFileName().toString().equals( SOURCE_FILENAME ) ) { path = path.getParent();
return makeProject( path ); while ( path.getNameCount() > 0 && !path.getFileName().toString().equals( SOURCE_FILENAME ) ) { path = path.getParent();
@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() ); }