Top Description Fields Constructors Methods
org.eclipse.jgit.lfs.server.s3

public Class S3Repository

extends Object
implements LargeFileRepository
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.lfs.server.LargeFileRepository
Static Imports
jakarta.servlet.http.HttpServletResponse.SC_OK, org.eclipse.jgit.lfs.server.s3.SignerV4.UNSIGNED_PAYLOAD, .SignerV4.X_AMZ_CONTENT_SHA256, .SignerV4.X_AMZ_EXPIRES, .SignerV4.X_AMZ_STORAGE_CLASS, org.eclipse.jgit.util.HttpSupport.HDR_CONTENT_LENGTH, .HttpSupport.METHOD_GET, .HttpSupport.METHOD_HEAD, .HttpSupport.METHOD_PUT

Repository storing LFS objects in Amazon S3
Since
4.3

Field Summary

Modifier and TypeField and Description
private S3Config

Constructor Summary

AccessConstructor and Description
public
S3Repository(S3Config
AWS S3 storage bucket configuration
config
)

Construct a LFS repository storing large objects in Amazon S3

Method Summary

Modifier and TypeMethod and Description
private void
assertNotEmpty(String message, String value)

protected void
cacheObjectMetaData(AnyLongObjectId
the object id identifying the object to be cached
oid
,
long
the object's size (in bytes)
size
)

Cache metadata (size) for an object to avoid extra roundtrip to S3 in order to retrieve this metadata for a given object.

public Response.Action
getDownloadAction(AnyLongObjectId
id of the object to download
oid
)

Implements org.eclipse.jgit.lfs.server.LargeFileRepository.getDownloadAction.

Get download action

private URL
private String
public long
getSize(AnyLongObjectId
id of the object
oid
)

Implements org.eclipse.jgit.lfs.server.LargeFileRepository.getSize.

Get size of an object

public Response.Action
getUploadAction(AnyLongObjectId
id of the object to upload
oid
,
long
size of the object to be uploaded
size
)

Implements org.eclipse.jgit.lfs.server.LargeFileRepository.getUploadAction.

Get upload action

public Response.Action
getVerifyAction(AnyLongObjectId
id of the object to be verified
id
)

Implements org.eclipse.jgit.lfs.server.LargeFileRepository.getVerifyAction.

Get verify action

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

s3Configback to summary
private S3Config s3Config

Constructor Detail

S3Repositoryback to summary
public S3Repository(S3Config config)

Construct a LFS repository storing large objects in Amazon S3

Parameters
config:S3Config

AWS S3 storage bucket configuration

Method Detail

assertNotEmptyback to summary
private void assertNotEmpty(String message, String value)
cacheObjectMetaDataback to summary
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. 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:AnyLongObjectId

the object id identifying the object to be cached

size:long

the object's size (in bytes)

getDownloadActionback to summary
public Response.Action getDownloadAction(AnyLongObjectId oid)

Implements org.eclipse.jgit.lfs.server.LargeFileRepository.getDownloadAction.

Doc from org.eclipse.jgit.lfs.server.LargeFileRepository.getDownloadAction.

Get download action

Parameters
oid:AnyLongObjectId

id of the object to download

Returns:Response.Action

Action for downloading the object

Annotations
@Override
getObjectUrlback to summary
private URL getObjectUrl(AnyLongObjectId oid)
getPathback to summary
private String getPath(AnyLongObjectId oid)
getSizeback to summary
public long getSize(AnyLongObjectId oid) throws IOException

Implements org.eclipse.jgit.lfs.server.LargeFileRepository.getSize.

Doc from org.eclipse.jgit.lfs.server.LargeFileRepository.getSize.

Get size of an object

Parameters
oid:AnyLongObjectId

id of the object

Returns:long

length of the object content in bytes, -1 if the object doesn't exist

Annotations
@Override
Exceptions
IOException:
if an IO error occurred
getUploadActionback to summary
public Response.Action getUploadAction(AnyLongObjectId oid, long size)

Implements org.eclipse.jgit.lfs.server.LargeFileRepository.getUploadAction.

Doc from org.eclipse.jgit.lfs.server.LargeFileRepository.getUploadAction.

Get upload action

Parameters
oid:AnyLongObjectId

id of the object to upload

size:long

size of the object to be uploaded

Returns:Response.Action

Action for uploading the object

Annotations
@Override
getVerifyActionback to summary
public Response.Action getVerifyAction(AnyLongObjectId id)

Implements org.eclipse.jgit.lfs.server.LargeFileRepository.getVerifyAction.

Doc from org.eclipse.jgit.lfs.server.LargeFileRepository.getVerifyAction.

Get verify action

Parameters
id:AnyLongObjectId

id of the object to be verified

Returns:Response.Action

Action for verifying the object, or null if the server doesn't support or require verification

Annotations
@Override
validateConfigback to summary
private void validateConfig(S3Config config)