Examples of FileSystemView


Examples of javax.swing.filechooser.FileSystemView

                }
            }
        }

        private void processRoot(final File root) {
            FileSystemView fileSystemView = getFileChooser().getFileSystemView();
            if (!fileSystemView.isFileSystem(root) || fileSystemView.isFileSystemRoot(root)) {
                predefinedStructure.add(root);
                if (!fileSystemView.isFileSystemRoot(root)) {
                    File[] children = fileSystemView.getFiles(root, false);
                    if (files != null) {
                        for (int i = 0; i < children.length; i++) {
                            if (fileSystemView.isFileSystemRoot(children[i])) {
                                predefinedStructure.add(children[i]);
                            }
                        }
                    }
                }
View Full Code Here

Examples of javax.swing.filechooser.FileSystemView

      String result = CustomFilter.fileTypeMap.get(suffix.toLowerCase());
      if (result == null) {
        // First see if we can create a temp file and use the getTypeDescription
        try {
            File file = File.createTempFile("temp", "." + suffix);
            FileSystemView fileSystemView = FileSystemView.getFileSystemView();
            result = fileSystemView.getSystemTypeDescription(file) + "s (*." + suffix.toLowerCase() + ")";
            file.delete();
            CustomFilter.fileTypeMap.put(suffix.toLowerCase(), result);
        }
        catch (IOException ioe) {
          //File could not be created, fall back to using the default Forte style syntax
View Full Code Here

Examples of javax.swing.filechooser.FileSystemView

      String result = CustomFilter.fileTypeMap.get(suffix.toLowerCase());
      if (result == null) {
        // First see if we can create a temp file and use the getTypeDescription
        try {
            File file = File.createTempFile("temp", "." + suffix);
            FileSystemView fileSystemView = FileSystemView.getFileSystemView();
            result = fileSystemView.getSystemTypeDescription(file) + "s (*." + suffix.toLowerCase() + ")";
            file.delete();
            CustomFilter.fileTypeMap.put(suffix.toLowerCase(), result);
        }
        catch (IOException ioe) {
          //File could not be created, fall back to using the default Forte style syntax
View Full Code Here

Examples of javax.swing.filechooser.FileSystemView

                .getCurrentDirectory());
        final File defaultDir = new File("testDir");
        defaultDir.deleteOnExit();
        defaultDir.mkdir();
        try {
            FileSystemView view = new FileSystemView() {
                @Override
                public File createNewFolder(final File containingDir) throws IOException {
                    return containingDir;
                }
View Full Code Here

Examples of org.apache.ftpserver.ftplet.FileSystemView

        if (request.hasArgument()) {
            dirName = request.getArgument();
        }

        // change directory
        FileSystemView fsview = session.getFileSystemView();
        boolean success = false;
        try {
            success = fsview.changeWorkingDirectory(dirName);
        } catch (Exception ex) {
            LOG.debug("Failed to change directory in file system", ex);
        }
        FtpFile cwd = fsview.getWorkingDirectory();
        if (success) {
            dirName = cwd.getAbsolutePath();
            session.write(LocalizedFileActionFtpReply.translate(session, request, context,
                    FtpReply.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "CWD",
                    dirName, cwd));
View Full Code Here

Examples of org.apache.ftpserver.ftplet.FileSystemView

                return;
            }

            // update different objects
            FileSystemFactory fmanager = context.getFileSystemManager();
            FileSystemView fsview = fmanager
                    .createFileSystemView(authenticatedUser);
            session.setLogin(fsview);
            stat.setLogin(session);

            // everything is fine - send login ok message
View Full Code Here

Examples of org.apache.ftpserver.ftplet.FileSystemView

        } catch (Exception e) {
            // swallow the exception, we're closing down the session anyways
            LOG.warn("Data connection threw an exception on disconnect", e);
        }
       
        FileSystemView fs = session.getFileSystemView();
        if(fs != null) {
            try  {
                fs.dispose();
            } catch (Exception e) {
                LOG.warn("FileSystemView threw an exception on disposal", e);
            }
        }
View Full Code Here

Examples of org.apache.ftpserver.ftplet.FileSystemView

        // reset state variables
        session.resetState();

        // change directory
        FileSystemView fsview = session.getFileSystemView();
        boolean success = false;
        try {
            success = fsview.changeWorkingDirectory("..");
        } catch (Exception ex) {
            LOG.debug("Failed to change directory in file system", ex);
        }
        FtpFile cwd = fsview.getWorkingDirectory();
        if (success) {
            String dirName = cwd.getAbsolutePath();
            session.write(LocalizedFileActionFtpReply.translate(session, request, context,
                    FtpReply.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "CDUP",
                    dirName, cwd));
View Full Code Here

Examples of org.apache.ftpserver.ftplet.FileSystemView

     */
    public void execute(final FtpIoSession session,
            final FtpServerContext context, final FtpRequest request)
            throws IOException, FtpException {
        session.resetState();
        FileSystemView fsview = session.getFileSystemView();
        String currDir = fsview.getWorkingDirectory().getAbsolutePath();
        session.write(LocalizedFtpReply.translate(session, request, context,
                FtpReply.REPLY_257_PATHNAME_CREATED, "PWD", currDir));
    }
View Full Code Here

Examples of org.apache.ftpserver.ftplet.FileSystemView

      varVal = session.getUser().getHomeDirectory();
    }

    // client directory
    else if (varName.equals(CLIENT_DIR)) {
      FileSystemView fsView = session.getFileSystemView();
      if (fsView != null) {
        try {
          varVal = fsView.getWorkingDirectory().getAbsolutePath();
        }
        catch (Exception ex) {
          varVal = "";
        }
      }
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.