クラス GridFsResource
java.lang.ObjectSE
org.springframework.core.io.AbstractResource
org.springframework.core.io.InputStreamResource
org.springframework.data.mongodb.gridfs.GridFsResource
- 実装されているすべてのインターフェース:
InputStreamSource、Resource、GridFsObject<ObjectSE,InputStreamSE>
public class GridFsResource
extends InputStreamResource
implements GridFsObject<ObjectSE,InputStreamSE>
GridFSFile ベースの Resource 実装。- 作成者:
- Oliver Gierke, Christoph Strobl, Hartmut Lang, Mark Paluch
ネストされたクラスの要約
インターフェース org.springframework.data.mongodb.gridfs.GridFsObject から継承されたネストクラス / インターフェース
GridFsObject.Optionsコンストラクターの概要
コンストラクターコンストラクター説明GridFsResource(com.mongodb.client.gridfs.model.GridFSFile file) 指定されたGridFSFileから新しいGridFsResourceを作成します。GridFsResource(com.mongodb.client.gridfs.model.GridFSFile file, InputStreamSE inputStream) メソッドのサマリー
修飾子と型メソッド説明static GridFsResource存在しないGridFsResourceを取得します。longbooleanexists()実際のファイルの内容。Resourceのコンテンツ型を返します。@Nullable ObjectSEGridFSFile.getId()値を単純な java 型に変換します。ファイル名。@Nullable com.mongodb.client.gridfs.model.GridFSFilegetId()Resourceの ID を返します。ファイルのメタデータなどの追加情報 (例: contentType)。longクラス org.springframework.core.io.InputStreamResource から継承されたメソッド
equals, hashCode, isOpenクラス org.springframework.core.io.AbstractResource から継承されたメソッド
createRelative, getFile, getFileForLastModifiedCheck, getURI, getURL, isFile, isReadable, readableChannel, toStringクラス java.lang.ObjectSE から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, wait, waitSE, waitSEインターフェース org.springframework.core.io.Resource から継承されたメソッド
getContentAsByteArray, getContentAsString, getFilePath
コンストラクターの詳細
GridFsResource
public GridFsResource(com.mongodb.client.gridfs.model.GridFSFile file) 指定されたGridFSFileから新しいGridFsResourceを作成します。- パラメーター:
file- null であってはなりません。
GridFsResource
- パラメーター:
file- null であってはなりません。inputStream- null であってはなりません。
メソッドの詳細
absent
存在しないGridFsResourceを取得します。- パラメーター:
filename- 存在しないリソースのファイル名は null であってはなりません。- 戻り値:
- 決して null にはなりません。
- 導入:
- 2.1
getInputStream
- 次で指定:
- インターフェース
InputStreamSourceのgetInputStream - オーバーライド:
- クラス
InputStreamResourceのgetInputStream - 例外:
IOExceptionSEIllegalStateExceptionSE
contentLength
- 次で指定:
- インターフェース
ResourceのcontentLength - オーバーライド:
- クラス
AbstractResourceのcontentLength - 例外:
IOExceptionSE
getFilename
インターフェースからコピーされた説明:GridFsObjectファイル名。- 次で指定:
- インターフェース
GridFsObject<ObjectSE,のInputStreamSE> getFilename - 次で指定:
- インターフェース
ResourceのgetFilename - オーバーライド:
- クラス
AbstractResourceのgetFilename - 例外:
IllegalStateExceptionSE
exists
public boolean exists()- 次で指定:
- インターフェース
Resourceのexists - オーバーライド:
- クラス
InputStreamResourceのexists
lastModified
- 次で指定:
- インターフェース
ResourceのlastModified - オーバーライド:
- クラス
AbstractResourceのlastModified - 例外:
IOExceptionSE
getDescription
- 次で指定:
- インターフェース
ResourceのgetDescription - オーバーライド:
- クラス
InputStreamResourceのgetDescription
getId
Resourceの ID を返します。- 戻り値:
- 決して null にはなりません。
- 例外:
IllegalStateExceptionSE- ファイルがexists()でない場合。
getFileId
インターフェースからコピーされた説明:GridFsObject- 次で指定:
- インターフェース
GridFsObject<ObjectSE,のInputStreamSE> getFileId - 戻り値:
- 実装によっては null になる場合があります。
getGridFSFile
public @Nullable com.mongodb.client.gridfs.model.GridFSFile getGridFSFile()- 戻り値:
- 基礎となる
GridFSFile。存在しない場合は null になります。 - 導入:
- 2.2
getContentType
Resourceのコンテンツ型を返します。- 戻り値:
- 決して null にはなりません。
- 例外:
com.mongodb.MongoGridFSException-GridFSFile.getMetadata()でコンテンツ型が宣言されておらず、GridFSFile経由でも提供されていない場合。IllegalStateExceptionSE- ファイルがexists()でない場合。
getContent
インターフェースからコピーされた説明:GridFsObject実際のファイルの内容。- 次で指定:
- インターフェース
GridFsObject<ObjectSE,のInputStreamSE> getContent - 戻り値:
getOptions
インターフェースからコピーされた説明:GridFsObjectファイルのメタデータなどの追加情報 (例: contentType)。- 次で指定:
- インターフェース
GridFsObject<ObjectSE,のInputStreamSE> getOptions - 戻り値:
- 決して null にはなりません。