1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-25 19:07:39 +00:00

Document several undocumented arguments and exceptions

This commit is contained in:
SquidDev
2017-05-05 16:07:18 +01:00
parent 7b07921a73
commit 76e926c090
10 changed files with 66 additions and 12 deletions

View File

@@ -34,6 +34,7 @@ public interface IMount
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram"
* @return If the file exists.
* @throws IOException If an error occurs when checking the existence of the file.
*/
public boolean exists( String path ) throws IOException;
@@ -42,6 +43,7 @@ public interface IMount
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprograms".
* @return If the file exists and is a directory
* @throws IOException If an error occurs when checking whether the file is a directory.
*/
public boolean isDirectory( String path ) throws IOException;
@@ -50,6 +52,7 @@ public interface IMount
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprograms".
* @param contents A list of strings. Add all the file names to this list.
* @throws IOException If the file was not a directory, or could not be listed.
*/
public void list( String path, List<String> contents ) throws IOException;
@@ -58,6 +61,7 @@ public interface IMount
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram".
* @return The size of the file, in bytes.
* @throws IOException If the file does not exist, or its size could not be determined.
*/
public long getSize( String path ) throws IOException;
@@ -66,6 +70,7 @@ public interface IMount
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram".
* @return A stream representing the contents of the file.
* @throws IOException If the file does not exist, or could not be opened.
*/
public InputStream openForRead( String path ) throws IOException;
}

View File

@@ -31,6 +31,7 @@ public interface IWritableMount extends IMount
* Creates a directory at a given path inside the virtual file system.
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/mynewprograms".
* @throws IOException If the directory already exists or could not be created.
*/
public void makeDirectory( String path ) throws IOException;
@@ -38,6 +39,7 @@ public interface IWritableMount extends IMount
* Deletes a directory at a given path inside the virtual file system.
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myoldprograms".
* @throws IOException If the file does not exist or could not be deleted.
*/
public void delete( String path ) throws IOException;
@@ -45,7 +47,8 @@ public interface IWritableMount extends IMount
* Opens a file with a given path, and returns an {@link OutputStream} for writing to it.
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram".
* @return a stream for writing to
* @return A stream for writing to
* @throws IOException If the file could not be opened for writing.
*/
public OutputStream openForWrite( String path ) throws IOException;
@@ -54,6 +57,7 @@ public interface IWritableMount extends IMount
*
* @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram".
* @return A stream for writing to.
* @throws IOException If the file could not be opened for writing.
*/
public OutputStream openForAppend( String path ) throws IOException;
@@ -62,6 +66,7 @@ public interface IWritableMount extends IMount
* mount, and write operations should fail once it reaches zero.
*
* @return The amount of free space, in bytes.
* @throws IOException If the remaining space could not be computed.
*/
public long getRemainingSpace() throws IOException;
}

View File

@@ -1,4 +1,4 @@
/**
/*
* This file is part of the public ComputerCraft API - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2016. This API may be redistributed unmodified and in full only.
* For help using the API, and posting your mods, visit the forums at computercraft.info.