Package io.fathom.cloud.sftp

Examples of io.fathom.cloud.sftp.RemoteFile


    private static boolean matches(ByteString a, HashCode b) {
        return Arrays.equals(a.toByteArray(), b.asBytes());
    }

    private RemoteFile buildRemoteFile(Sftp sftp, ByteString key, boolean mkdirs) throws IOException {
        RemoteFile file = buildRemoteFile(key);

        if (mkdirs) {
            // TODO: Cache created / not created state?
            sftp.mkdirs(file.getParentFile().getSshPath());
        }

        return file;
    }
View Full Code Here


        return file;
    }

    private RemoteFile buildRemoteFile(ByteString key) {
        File file = buildFile(this.remoteBaseDir.getSshPath(), key);
        RemoteFile remoteFile = new RemoteFile(file);
        return remoteFile;
    }
View Full Code Here

                throw new IOException("Could not rename file to cache file");
            }
        }

        try (Sftp sftp = buildSftp()) {
            RemoteFile remoteFile = buildRemoteFile(sftp, key, true);

            if (sftp.exists(remoteFile.getSshPath())) {
                // TODO: Verify that the file contents match??
                log.warn("TODO: Validate that remote files match for sftp");
                return;
            }
View Full Code Here

                    if (!name.startsWith(prefix)) {
                        continue;
                    }
                }

                listWithPrefix(sftp, ret, new RemoteFile(remoteBaseDir, name), prefix);
            }
        }

        return ret;
    }
View Full Code Here

        @Override
        public BlobStore get(String key) throws IOException {
            Preconditions.checkArgument(!Strings.isNullOrEmpty(key));
            Preconditions.checkArgument(LocalFilesystemBlobStore.isSafeFileName(key));

            return new SftpBlobStore(sshConfig, new RemoteFile(remoteBaseDir, key), new File(localCacheDir, key));
        }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.sftp.RemoteFile

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.