Package org.apache.sshd.server

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


                            }
                        }
                        String acc = ((pflags & (SSH_FXF_READ | SSH_FXF_WRITE)) != 0 ? "r" : "") +
                                ((pflags & SSH_FXF_WRITE) != 0 ? "w" : "");
                        if ((pflags & SSH_FXF_TRUNC) != 0) {
                            file.truncate();
                        }
                        String handle = UUID.randomUUID().toString();
                        handles.put(handle, new FileHandle(file, pflags)); // handle flags conversion
                        sendHandle(id, handle);
                    } catch (IOException e) {
View Full Code Here


                                    sendStatus(id, SSH_FX_FILE_ALREADY_EXISTS, path);
                                    return;
                                } else if (!file.isWritable()) {
                                    sendStatus(id, SSH_FX_FAILURE, "Can not create " + path);
                                }
                                file.truncate();
                                break;
                            }
                            case SSH_FXF_OPEN_EXISTING: {
                                if (!file.doesExist()) {
                                    if (!file.getParentFile().doesExist()) {
View Full Code Here

                                    } else {
                                        sendStatus(id, SSH_FX_NO_SUCH_FILE, path);
                                    }
                                    return;
                                }
                                file.truncate();
                                break;
                            }
                            default:
                                throw new IllegalArgumentException("Unsupported open mode: " + flags);
                        }
View Full Code Here

                            }
                        }
                        String acc = ((pflags & (SSH_FXF_READ | SSH_FXF_WRITE)) != 0 ? "r" : "") +
                                ((pflags & SSH_FXF_WRITE) != 0 ? "w" : "");
                        if ((pflags & SSH_FXF_TRUNC) != 0) {
                            file.truncate();
                        }
                        String handle = UUID.randomUUID().toString();
                        handles.put(handle, new FileHandle(file, pflags)); // handle flags conversion
                        sendHandle(id, handle);
                    } catch (IOException e) {
View Full Code Here

                                    sendStatus(id, SSH_FX_FILE_ALREADY_EXISTS, path);
                                    return;
                                } else if (!file.isWritable()) {
                                    sendStatus(id, SSH_FX_FAILURE, "Can not create " + path);
                                }
                                file.truncate();
                                break;
                            }
                            case SSH_FXF_OPEN_EXISTING: {
                                if (!file.doesExist()) {
                                    if (!file.getParentFile().doesExist()) {
View Full Code Here

                                    } else {
                                        sendStatus(id, SSH_FX_NO_SUCH_FILE, path);
                                    }
                                    return;
                                }
                                file.truncate();
                                break;
                            }
                            default:
                                throw new IllegalArgumentException("Unsupported open mode: " + flags);
                        }
View Full Code Here

                            }
                        }
                        String acc = ((pflags & (SSH_FXF_READ | SSH_FXF_WRITE)) != 0 ? "r" : "") +
                                ((pflags & SSH_FXF_WRITE) != 0 ? "w" : "");
                        if ((pflags & SSH_FXF_TRUNC) != 0) {
                            file.truncate();
                        }
                        String handle = UUID.randomUUID().toString();
                        handles.put(handle, new FileHandle(file, pflags)); // handle flags conversion
                        sendHandle(id, handle);
                    } catch (IOException e) {
View Full Code Here

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

                                    } else {
                                        sendStatus(id, SSH_FX_NO_SUCH_FILE, path);
                                    }
                                    return;
                                }
                                file.truncate();
                                break;
                            }
                            default:
                                throw new IllegalArgumentException("Unsupported open mode: " + flags);
                        }
View Full Code Here

                            }
                        }
                        String acc = ((pflags & (SSH_FXF_READ | SSH_FXF_WRITE)) != 0 ? "r" : "") +
                                ((pflags & SSH_FXF_WRITE) != 0 ? "w" : "");
                        if ((pflags & SSH_FXF_TRUNC) != 0) {
                            file.truncate();
                        }
                        String handle = UUID.randomUUID().toString();
                        handles.put(handle, new FileHandle(file, pflags)); // handle flags conversion
                        sendHandle(id, handle);
                    } catch (IOException e) {
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.