Examples of AllFileSelector


Examples of org.apache.commons.vfs.AllFileSelector

        FileObject fo3 = relativeToFO.resolveFile(dummyFileDirName);
        // now delete the dir heirarchy or fail
        if (fo3.exists()) {
            // now recursive delete the dir heirarcy
            int numbDeleted = fo3.delete(new AllFileSelector());
            System.out.println("numbCreated: " + numbCreated + " numbDeleted: " + numbDeleted);
            // assert the whole dir heirarchy was actually deleted.
            assertEquals(numbCreated, numbDeleted);
        } else {
            fail("Could not create dir heirarchy");
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

        // not cause re-listing of server)
        //children = newFolder.getChildren();
        //System.out.println("children in folder after redo getChildren : " + children.length);

        // assert both folder and nested file were deleted ok.
        int numbDeletedAtDest = newFolder.delete(new AllFileSelector());
        assertEquals(numbDeletedAtDest, 2);
    }
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

        }

        // delete the src file
        assertTrue(dummyDataFileSrc.delete());
        // delete the destination dir and its contained file
        int numbDeletedAtDest = newFolder.delete(new AllFileSelector());
        assertEquals(numbDeletedAtDest, 2);
    }
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

        } finally {
            // delete the src file
            assertTrue(dummyDataFileSrc.delete());
            // delete the destination dir and its contained file
            int numbDeletedAtDest = newFolder.delete(new AllFileSelector());
            assertEquals(numbDeletedAtDest, 2);
        }
    }
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

        // copy the source data to the target
        VFSUtil.copy(dummyDataDirSrc, dummyDataDirCopy,new MarkerListenerImpl(), doThirdPartyTransferForTwoGridFtpFileObjects);

        // delete directory heirarchies at both source and target and assert
        // number of files deleted == number of files created/copied.
        int numbDeletedSrc = dummyDataDirSrc.delete(new AllFileSelector());
        int numbDeletedCopy = dummyDataDirCopy.delete(new AllFileSelector());
        System.out.println("numbCreated: " + numbCreated);
        System.out.println("numbDeleted on Src: " + numbDeletedSrc + "  numbDeleted on Copy: " + numbDeletedCopy);
        assertEquals(numbDeletedSrc, numbDeletedCopy);
        assertEquals(numbDeletedSrc, numbCreated);
    }
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

        // need to delete the file/dir if it already exits
        if (fo.exists()) {
            if (fo.getType() == FileType.FILE) {
                fo.delete();
            } else if (fo.getType() == FileType.FOLDER) {
                fo.delete(new AllFileSelector());
            }
            assertFalse(fo.exists());// assert that it now dont exist
        }
    }
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

            if (destFo.getType().equals(FileType.FOLDER)) {
                log.debug("vfs FILE into FOLDER");
                // get a handle on the new file to create at the destination.
                FileObject nestedDestFo = destFo.resolveFile(srcFo.getName().getBaseName());
                // copyFileToFile(srcFo, nestedDestFo, false); //append false here
                nestedDestFo.copyFrom(srcFo, new AllFileSelector());

            } else {
                log.debug("vfs FILE to FILE");
                // copyFileToFile(srcFo, destFo, false); //append false here
                destFo.copyFrom(srcFo, new AllFileSelector());

            }
        } else if (srcFo.getType().equals(FileType.FOLDER)) {
            // copying the children of a folder into another folder
            if (destFo.getType().equals(FileType.FOLDER)) {
                log.debug("vfs FOLDER children into FOLDER");
                destFo.copyFrom(srcFo, new AllFileSelector());

            } else {
                throw new IOException("Cannot copy a folder to a destination that is not a folder");
            }
        } else {
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

            if (destFo.getType().equals(FileType.FOLDER)) {
                log.debug("vfs FILE into FOLDER");
                // get a handle on the new file to create at the destination.
                FileObject nestedDestFo = destFo.resolveFile(srcFo.getName().getBaseName());
                // copyFileToFile(srcFo, nestedDestFo, false); //append false here
                nestedDestFo.copyFrom(srcFo, new AllFileSelector());

            } else {
                log.debug("vfs FILE to FILE");
                // copyFileToFile(srcFo, destFo, false); //append false here
                destFo.copyFrom(srcFo, new AllFileSelector());

            }
        } else if (srcFo.getType().equals(FileType.FOLDER)) {
            // copying the children of a folder into another folder
            if (destFo.getType().equals(FileType.FOLDER)) {
                log.debug("vfs FOLDER children into FOLDER");
                destFo.copyFrom(srcFo, new AllFileSelector());

            } else {
                throw new IOException("Cannot copy a folder to a destination that is not a folder");
            }
        } else {
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

                copyNewResources(sourceFile, targetFile);
            }
            else if (sourceFile.getType().equals(FileType.FILE)) {
                if (!targetFile.exists()) {
                    getLog().info("Adding new overlay resource " + getBaseFolder().getName().getRelativeName(targetFile.getName()));
                    targetFile.copyFrom(sourceFile, new AllFileSelector());
                }
            }
        }
       
    }
View Full Code Here

Examples of org.apache.commons.vfs.AllFileSelector

   * @param destFile a FileObject representing file
   * @param overwrite true to create the destFile is doesn't exist.
   * @throws IOException
   */
    public static void copyIntoDir(final FileObject srcFile, FileObject destFile) throws IOException {
      destFile.copyFrom(srcFile, new AllFileSelector());
  }   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.