package tachyon.client;

import java.io.Closeable;
import java.io.IOException;
import java.util.List;

import tachyon.thrift.ClientFileInfo;

/**
 * Interface for Tachyon client APIs
 */
interface TachyonFSCore extends Closeable {

  // TODO add this when TachyonURI works.
  // /** Returns a URI whose scheme and authority identify this FileSystem. */
  // public TachyonURI getUri();

  /**
   * Creates a new file in the file system.
   *
   * @param path
   *          The path of the file
   * @param ufsPath
   *          The path of the file in the under file system. If this is empty, the file
   *          does not exist in the under file system yet.
   * @param blockSizeByte
   *          The size of the block in bytes. It is -1 iff ufsPath is non-empty.
   * @param recursive
   *          Creates necessary parent folders if true, not otherwise.
   * @return The file id, which is globally unique.
   */
  public int createFile(String path, String ufsPath, long blockSizeByte, boolean recursive)
      throws IOException;

  /**
   * Deletes a file or folder
   *
   * @param fileId
   *          The id of the file / folder. If it is not -1, path parameter is ignored. Otherwise,
   *          the method uses the path parameter.
   * @param path
   *          The path of the file / folder. It could be empty iff id is not -1.
   * @param recursive
   *          If fileId or path represents a non-empty folder, delete the folder recursively or not
   * @return true if deletes successfully, false otherwise.
   * @throws IOException
   */
  public boolean delete(int fileId, String path, boolean recursive) throws IOException;

  /**
   * Gets the ClientFileInfo object that represents the fileId, or the path if fileId is -1.
   *
   * @param fileId
   *          the file id of the file or folder.
   * @param path
   *          the path of the file or folder. valid iff fileId is -1.
   * @return the ClientFileInfo of the file or folder, null if the file or folder does not exist.
   * @throws IOException
   */
  public ClientFileInfo getFileStatus(int fileId, String path) throws IOException;

  /**
   * If the <code>path</code> is a directory, return all the direct entries in it. If the
   * <code>path</code> is a file, return its ClientFileInfo.
   *
   * @param path
   *          the target directory/file path
   * @return A list of ClientFileInfo, null if the file or folder does not exist.
   * @throws IOException
   */
  public List<ClientFileInfo> listStatus(String path) throws IOException;

  /**
   * Creates a folder.
   *
   * @param path
   *          the path of the folder to be created
   * @param recursive
   *          Creates necessary parent folders if true, not otherwise.
   * @return true if the folder is created successfully or already existing. false otherwise.
   * @throws IOException
   */
  public boolean mkdirs(String path, boolean recursive) throws IOException;

  /**
   * Renames a file or folder to another path.
   *
   * @param fileId
   *          The id of the source file / folder. If it is not -1, path parameter is ignored.
   *          Otherwise, the method uses the srcPath parameter.
   * @param srcPath
   *          The path of the source file / folder. It could be empty iff id is not -1.
   * @param dstPath
   *          The path of the destination file / folder. It could be empty iff id is not -1.
   * @return true if renames successfully, false otherwise.
   * @throws IOException
   */
  public boolean rename(int fileId, String srcPath, String dstPath) throws IOException;
}

@@ -447,38 +447,24 @@
  @param path
-%0A   *         
  The path of
@@ -488,38 +488,24 @@
 aram ufsPath
-%0A   *         
  The path of
@@ -562,24 +562,29 @@
 ty, the file
+ does
 %0A   *       
@@ -588,15 +588,8 @@
     
-  does 
 not 
@@ -649,30 +649,16 @@
 SizeByte
-%0A   *         
  The siz
@@ -734,38 +734,24 @@
 am recursive
-%0A   *         
  Creates nec
@@ -856,23 +856,16 @@
    */%0A  
-public 
 int crea
@@ -1021,38 +1021,24 @@
 param fileId
-%0A   *         
  The id of t
@@ -1098,27 +1098,16 @@
 ignored.
- Otherwise,
 %0A   *   
@@ -1107,25 +1107,34 @@
    *        
- 
+Otherwise,
  the method 
@@ -1174,30 +1174,16 @@
 ram path
-%0A   *         
  The pat
@@ -1263,30 +1263,16 @@
 ecursive
-%0A   *         
  If file
@@ -1342,16 +1342,28 @@
 ursively
+%0A   *       
  or not%0A
@@ -1447,39 +1447,32 @@
 ception%0A   */%0A  
-public 
 boolean delete(i
@@ -1657,30 +1657,16 @@
 m fileId
-%0A   *         
  the fil
@@ -1705,38 +1705,24 @@
  @param path
-%0A   *         
  the path of
@@ -1897,23 +1897,16 @@
    */%0A  
-public 
 ClientFi
@@ -2146,38 +2146,24 @@
  @param path
-%0A   *         
  the target 
@@ -2297,23 +2297,16 @@
    */%0A  
-public 
 List%3CCli
@@ -2413,30 +2413,16 @@
 ram path
-%0A   *         
  the pat
@@ -2472,30 +2472,16 @@
 ecursive
-%0A   *         
  Creates
@@ -2649,39 +2649,32 @@
 ception%0A   */%0A  
-public 
 boolean mkdirs(S
@@ -2801,30 +2801,16 @@
 m fileId
-%0A   *         
  The id 
@@ -2890,26 +2890,24 @@
    *        
-  
 Otherwise, t
@@ -2959,38 +2959,24 @@
 aram srcPath
-%0A   *         
  The path of
@@ -3061,22 +3061,8 @@
 Path
-%0A   *         
  The
@@ -3230,23 +3230,16 @@
    */%0A  
-public 
 boolean 

Remove public accessor for the interface methods. Interface methods are public by default.