Package org.apache.ftpserver.ftplet

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.getCurrentDirectory().getFullName();
                } catch (Exception ex) {
                    varVal = "";
                }
            }
        }
View Full Code Here


     * Get unique file object.
     */
    protected FileObject getUniqueFile(FtpIoSession session, FileObject oldFile)
            throws FtpException {
        FileObject newFile = oldFile;
        FileSystemView fsView = session.getFileSystemView();
        String fileName = newFile.getFullName();
        while (newFile.doesExist()) {
            newFile = fsView.getFileObject(fileName + '.'
                    + System.currentTimeMillis());
            if (newFile == null) {
                break;
            }
        }
View Full Code Here

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

        // change directory
        FileSystemView fsview = session.getFileSystemView();
        boolean success = false;
        try {
            success = fsview.changeDirectory(dirName);
        } catch (Exception ex) {
            LOG.debug("Failed to change directory in file system", ex);
        }
        if (success) {
            dirName = fsview.getCurrentDirectory().getFullName();
            session.write(FtpReplyUtil.translate(session, request, context,
                    FtpReply.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "CWD",
                    dirName));
        } else {
            session
View Full Code Here

                return;
            }

            // update different objects
            FileSystemManager 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

     * Get unique file object.
     */
    protected FtpFile getUniqueFile(FtpIoSession session, FtpFile oldFile)
            throws FtpException {
        FtpFile newFile = oldFile;
        FileSystemView fsView = session.getFileSystemView();
        String fileName = newFile.getAbsolutePath();
        while (newFile.doesExist()) {
            newFile = fsView.getFile(fileName + '.'
                    + System.currentTimeMillis());
            if (newFile == null) {
                break;
            }
        }
View Full Code Here

                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

TOP

Related Classes of org.apache.ftpserver.ftplet.FileSystemView

Copyright © 2018 www.massapicom. 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.