Package org.eclipse.jgit.lfs.server.s3
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
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionS3Repository
(S3Config config) Construct a LFS repository storing large objects in Amazon S3 -
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertNotEmpty
(String message, String value) protected void
cacheObjectMetaData
(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 actionprivate URL
private String
getPath
(AnyLongObjectId oid) long
getSize
(AnyLongObjectId oid) Get size of an objectgetUploadAction
(AnyLongObjectId oid, long size) Get upload actionGet verify actionprivate void
validateConfig
(S3Config config)
-
Field Details
-
s3Config
-
-
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:
getDownloadAction
in interfaceLargeFileRepository
- Parameters:
oid
- id of the object to download- Returns:
- Action for downloading the object
-
getUploadAction
Get upload action- Specified by:
getUploadAction
in 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:
getVerifyAction
in interfaceLargeFileRepository
- Parameters:
id
- id of the object to be verified- Returns:
- Action for verifying the object, or
null
if the server doesn't support or require verification
-
getSize
Get size of an object- Specified by:
getSize
in 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)
-
validateConfig
-
assertNotEmpty
-
getObjectUrl
-
getPath
-