0N/A/*
2362N/A * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/**
0N/A * Interface for managing the underlying file system
0N/A */
0N/A
0N/Apublic interface FtpFileSystemHandler {
0N/A /*
0N/A * Change current directory to.
0N/A * Returns <code>true</code> if operation was successful.
0N/A *
0N/A * @param path the path of the directory to change to, in either relative
0N/A * or absolute form.
0N/A * @return <code>true</code> if the operation was successful.
0N/A */
0N/A public boolean cd(String path);
0N/A /*
0N/A * Change current directory to parent.
0N/A * @return <code>true</code> if the operation was successful.
0N/A */
0N/A public boolean cdUp();
0N/A /*
0N/A * Print Working Directory. I.E. returns a string containing the current
0N/A * working directory full path.
0N/A */
0N/A public String pwd();
0N/A /*
0N/A * Tests if a specified file exists. Returns <code>true</code> if the file
0N/A * does exist.
0N/A * @param name can be either a relative pathname or an absolute pathname.
0N/A * @return <code>true</code> if the file exists.
0N/A */
0N/A public boolean fileExists(String name);
0N/A /*
0N/A * Get the content of a file. Returns an InputStream pointing to the
0N/A * content of the file whose name was passed as an argument.
0N/A * Returns <code>null</code> if the operation failed.
0N/A */
0N/A public java.io.InputStream getFile(String name);
0N/A /*
0N/A * Returns the size, in bytes, of the specified file.
0N/A *
0N/A * @param name the pathname, which can be either relative or absolute,
0N/A * of the file.
0N/A * @return the size in bytes of the file.
0N/A */
0N/A public long getFileSize(String name);
0N/A /*
0N/A * Get the content of the current directory. Returns an InputStream
0N/A * pointing to the content (in text form) of the current directory.
0N/A * Returns <code>null</code> if the operation failed.
0N/A */
0N/A public java.io.InputStream listCurrentDir();
0N/A /*
0N/A * Open a file for writing on the server and provides an OutputStream
0N/A * pointing to it.
0N/A * Returns <code>null</code> if the operation failed.
0N/A */
0N/A public java.io.OutputStream putFile(String name);
0N/A /*
0N/A * Remove the specified file on the server. Returns <code>true</code> if
0N/A * the operation was successful.
0N/A * @return <code>true</code> if the operation was successful.
0N/A */
0N/A public boolean removeFile(String name);
0N/A /*
0N/A * Creates a directory on the server. Returns <code>true</code> if the
0N/A * operation was successful.
0N/A *
0N/A * @param name the path of the directory to create, which can be
0N/A * either in relative or absolute for.
0N/A * @return <code>true</code> if the operation was successful.
0N/A */
0N/A public boolean mkdir(String name);
0N/A /*
0N/A * Rename a file in the current working directory.
0N/A * Returns <code>true</code> if the operation was successful.
0N/A *
0N/A * @param from the name of the file to rename.
0N/A * @param to the new name.
0N/A * @return <code>true</code> if the operation was successful.
0N/A */
0N/A
0N/A public boolean rename(String from, String to);
0N/A}