Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileObject.createFolder()


        }

        // create a new folder relative to relativeToFODest
        FileObject newFolder = relativeToFODest.resolveFile(dummyFileDirName);
        assertTrue(!newFolder.exists());
        newFolder.createFolder();
        assertTrue(newFolder.exists());

        try {
            // get the children of the empty folder
            FileObject[] children = newFolder.getChildren();
View Full Code Here


        // create the same directory on the target (but not the whole heirarchy)

        FileObject dummyDataDirCopy = relativeToFODest.resolveFile(dummyFileDirName);
        System.out.println("creating destination directory");
        dummyDataDirCopy.createFolder();

        assertEquals(FileType.FOLDER, dummyDataDirCopy.getType());
        System.out.println("Yes, you've just created a folder!");

        System.out.println("About to copy..");
View Full Code Here

        }

        if (!fo3.exists()) {
            // ok, 'dummyFileDirName' dir does not already exist so can
            // continue to create the folder and files with and without content
            fo3.createFolder();
            System.out.println("created folder: " + fo3.getURL());

            content = "a text can delete me";
            newFileCreation = this.createFileWithDummyContent(fo3, "a_.txt", content);
            if (assertContent) {
View Full Code Here

        FileObject unitTestFolder = tmpFolder.resolveFile("UnitTestFolder");

        if(!unitTestFolder.exists())
        {
            unitTestFolder.createFolder();
        }

        for(int i = 0; i < 10; i++)
        {
            FileObject file = unitTestFolder.resolveFile("TestFile" + i + ".txt");
View Full Code Here

    public Node addNode(String name, String type) throws ItemExistsException, PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException {
        try {
            if (type.equals(Constants.NT_FOLDER) || type.equals(Constants.JAHIANT_FOLDER) || type.equals(Constants.JAHIANT_CONTENTLIST)) {
                FileObject obj = fileObject.resolveFile(name);
                obj.createFolder();
                return new VFSNodeImpl(obj, session);
            } else if (type.equals(Constants.NT_FILE) || type.equals(Constants.JAHIANT_FILE)) {
                FileObject obj = fileObject.resolveFile(name);
                obj.createFile();
                return new VFSNodeImpl(obj, session);
View Full Code Here

        // assert dir does not exist
        newFolder = relativeToFO.resolveFile(dummyFileDirName);
        assertTrue(!newFolder.exists());

        // create the dir and assert it exists
        newFolder.createFolder();
        assertTrue(newFolder.exists());

        // rename the newly created fileNew (which deletes fileNew).
        FileObject movedFolder = relativeToFO.resolveFile(dummyFileDirNameRenamed);
        boolean ok = newFolder.canRenameTo(movedFolder);
View Full Code Here

        // create a new dir and delete it again
        fo3 = fsManager.resolveFile(relativeToFO, dummyFileDirName);
        if (!fo3.exists()) {
            System.out.println("Creating Dir: " + dummyFileDirName);
            fo3.createFolder();
            assertTrue(fo3.exists());// assert that it now exists
            assertTrue(fo3.getType() == FileType.FOLDER);
            System.out.println("File exists and is of type FOLDER, now deleting");
            fo3.delete();// now delete the folder
            assertFalse(fo3.exists());// assert that it now dont exist
View Full Code Here

        // create a new folder relative to relativeToFODest
        FileObject newFolder = relativeToFOSrc.resolveFile(dummyFileDirName);

        assertTrue(!newFolder.exists());
        newFolder.createFolder();
        assertTrue(newFolder.exists());

        // assert folder does not contain any children
        // creates children FileObjects by calling doListChildren
        // causes listing srb server !
View Full Code Here

        }

        // create a new folder relative to relativeToFODest
        FileObject newFolder = relativeToFODest.resolveFile(dummyFileDirName);
        assertTrue(!newFolder.exists());
        newFolder.createFolder();
        assertTrue(newFolder.exists());

        // copy dummyDataFileSrc into newFolder

        VFSUtil.copy(dummyDataFileSrc, newFolder, new MarkerListenerImpl(), doThirdPartyTransferForTwoGridFtpFileObjects);
View Full Code Here

        }

        // create a new folder relative to relativeToFODest
        FileObject newFolder = relativeToFODest.resolveFile(dummyFileDirName);
        assertTrue(!newFolder.exists());
        newFolder.createFolder();
        assertTrue(newFolder.exists());

        try {
            // get the children of the empty folder
            FileObject[] children = newFolder.getChildren();
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.