public class DataDirectory extends DataObject
Modifier and Type | Class and Description |
---|---|
protected class |
DataDirectory.DirectoryListResponse |
protected class |
DataDirectory.DirectoryMetadata |
protected class |
DataDirectory.FileMetadata |
DataObject.DataObjectType
client, dataType, 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 |
create(DataAcl dataAcl) |
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,
java.lang.Boolean getAcl)
Gets a single page of the directory listing.
|
DataAcl |
getPermissions() |
DataFile |
putFile(java.io.File file)
Convenience wrapper for putting a File
|
boolean |
updatePermissions(DataAcl dataAcl) |
getName, getParent, getType, getUrl, isDirectory, isFile, toString
public DataDirectory(HttpClient client, java.lang.String dataUrl)
public boolean exists() throws APIException
exists
in class DataObject
APIException
- 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
APIException
public java.lang.Iterable<DataDirectory> dirs() throws APIException
APIException
public 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 create(DataAcl dataAcl) throws APIException
APIException
public 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 APIpublic DataAcl getPermissions() throws APIException
APIException
public boolean updatePermissions(DataAcl dataAcl) throws APIException
APIException
protected DataDirectory.DirectoryListResponse getPage(java.lang.String marker, java.lang.Boolean getAcl) 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