Examples of doesExist()


Examples of org.apache.sshd.common.file.SshFile.doesExist()

        if (accValue == 0) {
            String path = request.getPath();
            int flags = request.getFlags();
            // attrs
            SshFile file = resolveFile(path);
            if (file.doesExist()) {
                if (((flags & SSH_FXF_CREAT) != 0) && ((flags & SSH_FXF_EXCL) != 0)) {
                    return new SshFxpStatusReply(id, SSH_FX_FILE_ALREADY_EXISTS, path);
                }
            } else {
                if ((flags & SSH_FXF_CREAT) != 0) {
View Full Code Here

Examples of org.apache.sshd.common.file.SshFile.doesExist()

            int flags = request.getFlags();
            // attrs
            SshFile file = resolveFile(path);
            switch (flags & SSH_FXF_ACCESS_DISPOSITION) {
                case SSH_FXF_CREATE_NEW: {
                    if (file.doesExist()) {
                        return new SshFxpStatusReply(id, SSH_FX_FILE_ALREADY_EXISTS, path);
                    } else if (!file.isWritable()) {
                        return new SshFxpStatusReply(id, SSH_FX_PERMISSION_DENIED, "Can not create " + path);
                    }
                    file.create();
View Full Code Here

Examples of org.apache.sshd.common.file.SshFile.doesExist()

                    }
                    file.create();
                    break;
                }
                case SSH_FXF_CREATE_TRUNCATE: {
                    if (file.doesExist()) {
                        return new SshFxpStatusReply(id, SSH_FX_FILE_ALREADY_EXISTS, path);
                    } else if (!file.isWritable()) {
                        return new SshFxpStatusReply(id, SSH_FX_PERMISSION_DENIED, "Can not create " + path);
                    }
                    file.truncate();
View Full Code Here

Examples of org.apache.sshd.common.file.SshFile.doesExist()

                    }
                    file.truncate();
                    break;
                }
                case SSH_FXF_OPEN_EXISTING: {
                    if (!file.doesExist()) {
                        if (!file.getParentFile().doesExist()) {
                            return new SshFxpStatusReply(id, SSH_FX_NO_SUCH_PATH, path);
                        } else {
                            return new SshFxpStatusReply(id, SSH_FX_NO_SUCH_FILE, path);
                        }
View Full Code Here

Examples of org.apache.sshd.common.file.SshFile.doesExist()

                        }
                    }
                    break;
                }
                case SSH_FXF_OPEN_OR_CREATE: {
                    if (!file.doesExist()) {
                        file.create();
                    }
                    break;
                }
                case SSH_FXF_TRUNCATE_EXISTING: {
View Full Code Here

Examples of org.apache.sshd.common.file.SshFile.doesExist()

                        file.create();
                    }
                    break;
                }
                case SSH_FXF_TRUNCATE_EXISTING: {
                    if (!file.doesExist()) {
                        if (!file.getParentFile().doesExist()) {
                            return new SshFxpStatusReply(id, SSH_FX_NO_SUCH_PATH, path);
                        } else {
                            return new SshFxpStatusReply(id, SSH_FX_NO_SUCH_FILE, path);
                        }
View Full Code Here

Examples of org.apache.sshd.common.file.SshFile.doesExist()

        } else if (!path.doesExist() && path.getParentFile().doesExist() && path.getParentFile().isDirectory()) {
            file = path;
        } else {
            throw new IOException("Can not write to " + path);
        }
        if (!(file.doesExist() && file.isDirectory()) && !file.mkdir()) {
            throw new IOException("Could not create directory " + file);
        }

        if (preserve) {
            Map<SshFile.Attribute, Object> attrs = new HashMap<SshFile.Attribute, Object>();
View Full Code Here

Examples of org.apache.sshd.common.file.SshFile.doesExist()

        } else if (!path.doesExist() && path.getParentFile().doesExist() && path.getParentFile().isDirectory()) {
            file = path;
        } else {
            throw new IOException("Can not write to " + path);
        }
        if (file.doesExist() && file.isDirectory()) {
            throw new IOException("File is a directory: " + file);
        } else if (file.doesExist() && !file.isWritable()) {
            throw new IOException("Can not write to file: " + file);
        }
        OutputStream os = file.createOutputStream(0);
View Full Code Here

Examples of org.apache.sshd.server.SshFile.doesExist()

                    {
                        basedir = pattern.substring( 0, lastSep );
                        pattern = pattern.substring( lastSep + 1 );
                    }
                    SshFile file = root.getFile( basedir + "/" + pattern );
                    if ( !file.doesExist() )
                    {
                        exitValue = WARNING;
                        throw new IOException( file + ": no such file or directory" );
                    }
                    if ( file.isFile() )
View Full Code Here

Examples of org.apache.sshd.server.SshFile.doesExist()

        }
        else
        {
            throw new IOException( "Can not write to " + path );
        }
        if ( !( file.doesExist() && file.isDirectory() ) && !file.mkdir() )
        {
            throw new IOException( "Could not create directory " + file );
        }

        ack();
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.