| Constructor and Description |
|---|
FileStorage(File repositoryPath,
String storageName)
コンストラクタ。
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearEntities()
ストレージをクリアする。
|
boolean |
create()
ストレージを作成する。
既にストレージが存在する場合、失敗する。
レポジトリ内に、ストレージ名と同じ名前のディレクトリを作成する。
|
boolean |
createEntity(String entityName)
ユニークエンティティを作成する。
エンティティ名がユニークでない場合、falseを返す。
|
void |
delete()
ストレージを破棄する。
clearEntitiesを呼び出して内容を消去した後、ストレージ自身を破棄します。
|
void |
deleteEntity(String entityName)
ストレージ内のエンティティを削除する。
|
boolean |
entityExists(String entityName)
ストレージ内にエンティティが存在するかどうかを返す。
|
boolean |
exists()
ストレージが存在するかどうかを返す。
|
protected File |
getEntityFile(String entityName)
エンティティ名からファイルを取得する。
|
InputStream |
getInputStream(String aFileName)
ストレージ内のエンティティへの読み込みストリームを作成して返す。
|
String |
getName()
ストレージの名前を取得する。
|
OutputStream |
getOutputStream(String entityName)
ストレージ内のエンティティへの書き出しストリームを作成して返す。
|
protected File |
getStorageFile(File repositoryPath,
String storageName) |
String[] |
listEntityNames()
エンティティ名を列挙する。
|
public String getName()
public boolean exists()
public boolean create()
public void delete()
throws IOException
delete in interface StorageIOException - 削除に失敗したpublic String[] listEntityNames()
listEntityNames in interface Storagepublic void clearEntities()
throws IOException
clearEntities in interface StorageFileNotFoundException - ストレージが見つからないIOException - 削除に失敗したpublic boolean entityExists(String entityName)
entityExists in interface StorageentityName - 存在を確認するファイル名public InputStream getInputStream(String aFileName) throws IOException
getInputStream in interface StorageaFileName - ストリームを作成するエンティティ名FileNotFoundException - 情報を読み込むファイルを開けないIOException - 入力ストリームの取得に失敗したpublic OutputStream getOutputStream(String entityName) throws IOException
getOutputStream in interface StorageentityName - ストリームを作成するエンティティ名FileNotFoundException - 情報を書き出すファイルを開けないIOException - 出力ストリームの取得に失敗したpublic boolean createEntity(String entityName) throws IOException
createEntity in interface StorageentityName - エンティティ名IOException - エンティティの作成に失敗したpublic void deleteEntity(String entityName) throws IOException
deleteEntity in interface StorageentityName - エンティティ名IOException - 削除に失敗した