public class DataDirectory extends DataObject
| Modifier and Type | Class and Description |
|---|---|
protected class |
DataDirectory.DirectoryListResponse |
protected class |
DataDirectory.DirectoryMetadata |
protected class |
DataDirectory.FileMetadata |
client, path| Constructor and Description |
|---|
DataDirectory(HttpClient client,
java.lang.String dataUrl) |
| Modifier and Type | Method and Description |
|---|---|
void |
create()
Creates this directory via the Algorithmia Data API
|
void |
delete(boolean forceDelete)
Creates this directory vi the Algorithmia Data API
|
java.lang.Iterable<DataDirectory> |
dirs() |
boolean |
exists()
Determine if this Algorithmia data directory exists
|
DataFile |
file(java.lang.String filename)
Queries the DataAPI for a particular data file
|
java.lang.Iterable<DataFile> |
files() |
DataDirectoryIterator |
getDirIter()
Deprecated.
|
DataFileIterator |
getFileIter()
Deprecated.
|
protected DataDirectory.DirectoryListResponse |
getPage(java.lang.String marker)
Gets a single page of the directory listing.
|
DataFile |
putFile(java.io.File file)
Convenience wrapper for putting a File
|
getName, getParent, getUrl, toStringpublic DataDirectory(HttpClient client, java.lang.String dataUrl)
public boolean exists()
throws APIException
exists in class DataObjectAPIException - if there were any problems communicating with the Algorithmia API@Deprecated public DataFileIterator getFileIter() throws APIException
APIException - if there were any problems communicating with the Algorithmia APIpublic java.lang.Iterable<DataFile> files() throws APIException
APIException@Deprecated public DataDirectoryIterator getDirIter() throws APIException
APIExceptionpublic java.lang.Iterable<DataDirectory> dirs() throws APIException
APIExceptionpublic DataFile file(java.lang.String filename)
filename - the name of the file within this collection to get a reference forpublic DataFile putFile(java.io.File file) throws APIException, java.io.FileNotFoundException
file - a file to put into this data directoryAPIException - if there were any problems communicating with the Algorithmia APIjava.io.FileNotFoundException - if the specified file does not existpublic void create()
throws APIException
APIException - if there were any problems communicating with the Algorithmia APIpublic void delete(boolean forceDelete)
throws APIException
forceDelete - forces deletion of the directory even if it still has other files in itAPIException - if there were any problems communicating with the Algorithmia APIprotected DataDirectory.DirectoryListResponse getPage(java.lang.String marker) throws APIException
marker - indicates the specific page to fetch; first page is fetched if nullAPIException - if there were any problems communicating with the Algorithmia API