Package org.apache.commons.vfs

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


    {
        FileObject scratchFolder = getWriteFolder();

        // Make sure the test folder is empty
        scratchFolder.delete(Selectors.EXCLUDE_SELF);
        scratchFolder.createFolder();

        return scratchFolder;
    }

    /**
 
View Full Code Here


     */
    private void handleFiles() throws Exception
    {
        // Locate the destination folder, and make sure it exists
        final FileObject destFolder = resolveFile(destDirUrl);
        destFolder.createFolder();

        // Locate the source files, and make sure they exist
        FileName srcDirName = null;
        if (srcDirUrl !=null )
        {
View Full Code Here

        try
        {
            final FileObject dir = resolveFile(dirName);
            final String message = Messages.getString("vfs.tasks/mkdir.create-folder.info", dir);
            log(message);
            dir.createFolder();
        }
        catch (final FileSystemException e)
        {
            throw new BuildException(e);
        }
View Full Code Here

        try
        {
          glassPane.setVisible(true);
          glassPane.setCursor(new Cursor(Cursor.WAIT_CURSOR));
          final FileObject child = treeNode.resolveFile(newFolderDialog.getFolderName().replaceAll("\\%", "%25").replaceAll("\\!", "%21"));
          child.createFolder();
          if (child instanceof WebSolutionFileObject)
          {
            final WebSolutionFileObject webSolutionFileObject = (WebSolutionFileObject) child;
            webSolutionFileObject.setDescription(newFolderDialog.getDescription());
          }
View Full Code Here

          if (child instanceof WebSolutionFileObject)
          {
            final WebSolutionFileObject webSolutionFileObject = (WebSolutionFileObject) child;
            webSolutionFileObject.setDescription(newFolderDialog.getDescription());
          }
          child.createFolder();
          repositoryTreeModel.fireTreeDataChanged();
          repositoryBrowser.setSelectionPath(selectionPath.getParentPath().pathByAddingChild(child));
          setDirty(true);
        }
        catch (Exception e1)
View Full Code Here

            FileObject answer = fileSystemManager.resolveFile(path);
            if (answer == null) {
                throw new JBIException("Could not resolve file: " + path);
            }
            try {
                answer.createFolder();
            }
            catch (FileSystemException e) {
                throw new JBIException("Failed to create folder: " + e, e);
            }
            return answer;
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

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.