クラス 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
を取得します。long
boolean
exists()
実際のファイルの内容。Resource
のコンテンツ型を返します。GridFSFile.getId()
値を単純な java 型に変換します。ファイル名。com.mongodb.client.gridfs.model.GridFSFile
getId()
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
コンストラクターの詳細
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
- 例外:
IOExceptionSE
IllegalStateExceptionSE
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
- 戻り値:
- 基礎となる
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 にはなりません。