public class FileLfsRepository extends java.lang.Object implements LargeFileRepository
| Modifier and Type | Field and Description |
|---|---|
private java.nio.file.Path |
dir |
private static char[] |
hexchar |
private java.lang.String |
url |
| Constructor and Description |
|---|
FileLfsRepository(java.lang.String url,
java.nio.file.Path dir)
Constructor for FileLfsRepository.
|
| Modifier and Type | Method and Description |
|---|---|
private static void |
formatHexChar(char[] dst,
int p,
int b) |
private Response.Action |
getAction(AnyLongObjectId id) |
java.nio.file.Path |
getDir()
Get the storage directory
|
Response.Action |
getDownloadAction(AnyLongObjectId id)
Get download action
|
(package private) AtomicObjectOutputStream |
getOutputStream(AnyLongObjectId id) |
protected java.nio.file.Path |
getPath(AnyLongObjectId id)
Get the path where the given object is stored
|
(package private) java.nio.channels.ReadableByteChannel |
getReadChannel(AnyLongObjectId id) |
long |
getSize(AnyLongObjectId id)
Get size of an object
|
Response.Action |
getUploadAction(AnyLongObjectId id,
long size)
Get upload action
|
java.lang.String |
getUrl() |
Response.Action |
getVerifyAction(AnyLongObjectId id)
Get verify action
|
void |
setUrl(java.lang.String url) |
private static char[] |
toHexCharArray(int b) |
private java.lang.String url
private final java.nio.file.Path dir
private static final char[] hexchar
public FileLfsRepository(java.lang.String url,
java.nio.file.Path dir)
throws java.io.IOException
Constructor for FileLfsRepository.
url - external URL of this repositorydir - storage directoryjava.io.IOExceptionpublic Response.Action getDownloadAction(AnyLongObjectId id)
getDownloadAction in interface LargeFileRepositoryid - id of the object to downloadpublic Response.Action getUploadAction(AnyLongObjectId id, long size)
getUploadAction in interface LargeFileRepositoryid - id of the object to uploadsize - size of the object to be uploaded@Nullable public Response.Action getVerifyAction(AnyLongObjectId id)
getVerifyAction in interface LargeFileRepositoryid - id of the object to be verifiednull if the server
doesn't support or require verificationpublic long getSize(AnyLongObjectId id) throws java.io.IOException
getSize in interface LargeFileRepositoryid - id of the objectjava.io.IOExceptionpublic java.nio.file.Path getDir()
protected java.nio.file.Path getPath(AnyLongObjectId id)
id - id of a large objectprivate Response.Action getAction(AnyLongObjectId id)
java.nio.channels.ReadableByteChannel getReadChannel(AnyLongObjectId id) throws java.io.IOException
java.io.IOExceptionAtomicObjectOutputStream getOutputStream(AnyLongObjectId id) throws java.io.IOException
java.io.IOExceptionprivate static char[] toHexCharArray(int b)
private static void formatHexChar(char[] dst,
int p,
int b)
public java.lang.String getUrl()
public void setUrl(java.lang.String url)
url - the url of the content server