Class S3Repository
java.lang.Object
org.eclipse.jgit.lfs.server.s3.S3Repository
- All Implemented Interfaces:
LargeFileRepository
Repository storing LFS objects in Amazon S3
- Since:
- 4.3
-
Constructor Summary
ConstructorsConstructorDescriptionS3Repository(S3Config config) Construct a LFS repository storing large objects in Amazon S3 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcacheObjectMetaData(AnyLongObjectId oid, long size) Cache metadata (size) for an object to avoid extra roundtrip to S3 in order to retrieve this metadata for a given object.Get download actionlonggetSize(AnyLongObjectId oid) Get size of an objectgetUploadAction(AnyLongObjectId oid, long size) Get upload actionGet verify action
-
Constructor Details
-
S3Repository
Construct a LFS repository storing large objects in Amazon S3- Parameters:
config- AWS S3 storage bucket configuration
-
-
Method Details
-
getDownloadAction
Get download action- Specified by:
getDownloadActionin interfaceLargeFileRepository- Parameters:
oid- id of the object to download- Returns:
- Action for downloading the object
-
getUploadAction
Get upload action- Specified by:
getUploadActionin interfaceLargeFileRepository- Parameters:
oid- id of the object to uploadsize- size of the object to be uploaded- Returns:
- Action for uploading the object
-
getVerifyAction
Get verify action- Specified by:
getVerifyActionin interfaceLargeFileRepository- Parameters:
id- id of the object to be verified- Returns:
- Action for verifying the object, or
nullif the server doesn't support or require verification
-
getSize
Get size of an object- Specified by:
getSizein interfaceLargeFileRepository- Parameters:
oid- id of the object- Returns:
- length of the object content in bytes, -1 if the object doesn't exist
- Throws:
IOException
-
cacheObjectMetaData
Cache metadata (size) for an object to avoid extra roundtrip to S3 in order to retrieve this metadata for a given object. Subclasses can implement a local cache and override {getSize(AnyLongObjectId)to retrieve the object size from the local cache to eliminate the need for another roundtrip to S3- Parameters:
oid- the object id identifying the object to be cachedsize- the object's size (in bytes)
-