aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal')
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/AtomicObjectOutputStream.java6
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConfig.java6
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java12
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java1
4 files changed, 17 insertions, 8 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/AtomicObjectOutputStream.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/AtomicObjectOutputStream.java
index 3f1f0acac4..009250294e 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/AtomicObjectOutputStream.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/AtomicObjectOutputStream.java
@@ -45,6 +45,7 @@ public class AtomicObjectOutputStream extends OutputStream {
* @param id
* a {@link org.eclipse.jgit.lfs.lib.AnyLongObjectId} object.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public AtomicObjectOutputStream(Path path, AnyLongObjectId id)
throws IOException {
@@ -61,6 +62,7 @@ public class AtomicObjectOutputStream extends OutputStream {
* @param path
* a {@link java.nio.file.Path} object.
* @throws java.io.IOException
+ * if an IO error occurred
*/
public AtomicObjectOutputStream(Path path) throws IOException {
this(path, null);
@@ -78,25 +80,21 @@ public class AtomicObjectOutputStream extends OutputStream {
return id;
}
- /** {@inheritDoc} */
@Override
public void write(int b) throws IOException {
out.write(b);
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b) throws IOException {
out.write(b);
}
- /** {@inheritDoc} */
@Override
public void write(byte[] b, int off, int len) throws IOException {
out.write(b, off, len);
}
- /** {@inheritDoc} */
@Override
public void close() throws IOException {
out.close();
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConfig.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConfig.java
index 857ccbe056..0469337b1f 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConfig.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConfig.java
@@ -70,6 +70,7 @@ public class LfsConfig {
*
* @return the delegate {@link Config}
* @throws IOException
+ * if an IO error occurred
*/
private Config getDelegate() throws IOException {
if (delegate == null) {
@@ -86,6 +87,7 @@ public class LfsConfig {
* @return The loaded lfs config
*
* @throws IOException
+ * if an IO error occurred
*/
private Config load() throws IOException {
Config result = null;
@@ -114,6 +116,7 @@ public class LfsConfig {
*
* @return the config, or <code>null</code>
* @throws IOException
+ * if an IO error occurred
*/
@Nullable
private Config loadFromWorkingTree()
@@ -139,6 +142,7 @@ public class LfsConfig {
*
* @return the config, or <code>null</code> if the entry does not exist
* @throws IOException
+ * if an IO error occurred
*/
@Nullable
private Config loadFromIndex()
@@ -162,6 +166,7 @@ public class LfsConfig {
*
* @return the config, or <code>null</code> if the file does not exist
* @throws IOException
+ * if an IO error occurred
*/
@Nullable
private Config loadFromHead() throws IOException {
@@ -207,6 +212,7 @@ public class LfsConfig {
* the key name
* @return a String value from the config, <code>null</code> if not found
* @throws IOException
+ * if an IO error occurred
*/
@Nullable
public String getString(final String section, final String subsection,
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java
index 12b688d157..1a4e85ded6 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java
@@ -9,6 +9,7 @@
*/
package org.eclipse.jgit.lfs.internal;
+import static org.eclipse.jgit.lib.Constants.DEFAULT_REMOTE_NAME;
import static org.eclipse.jgit.util.HttpSupport.ENCODING_GZIP;
import static org.eclipse.jgit.util.HttpSupport.HDR_ACCEPT;
import static org.eclipse.jgit.util.HttpSupport.HDR_ACCEPT_ENCODING;
@@ -21,7 +22,7 @@ import java.net.URL;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.Map;
import java.util.TreeMap;
@@ -67,6 +68,7 @@ public class LfsConnectionFactory {
* @return the connection for the lfs server. e.g.
* "https://github.com/github/git-lfs.git/info/lfs"
* @throws IOException
+ * if an IO error occurred
*/
public static HttpConnection getLfsConnection(Repository db, String method,
String purpose) throws IOException {
@@ -127,8 +129,7 @@ public class LfsConnectionFactory {
// This could be done better (more precise logic), but according
// to https://github.com/git-lfs/git-lfs/issues/1759 git-lfs
// generally only supports 'origin' in an integrated workflow.
- if (lfsUrl == null && (remote.equals(
- org.eclipse.jgit.lib.Constants.DEFAULT_REMOTE_NAME))) {
+ if (lfsUrl == null && remote.equals(DEFAULT_REMOTE_NAME)) {
remoteUrl = config.getString(
ConfigConstants.CONFIG_KEY_REMOTE, remote,
ConfigConstants.CONFIG_KEY_URL);
@@ -252,6 +253,8 @@ public class LfsConnectionFactory {
}
/**
+ * Create request that can be serialized to JSON
+ *
* @param operation
* the operation to perform, e.g. Protocol.OPERATION_DOWNLOAD
* @param resources
@@ -263,7 +266,7 @@ public class LfsConnectionFactory {
Protocol.Request req = new Protocol.Request();
req.operation = operation;
if (resources != null) {
- req.objects = new LinkedList<>();
+ req.objects = new ArrayList<>();
for (LfsPointer res : resources) {
Protocol.ObjectSpec o = new Protocol.ObjectSpec();
o.oid = res.getOid().getName();
@@ -287,6 +290,7 @@ public class LfsConnectionFactory {
* no timeout can be determined, the token will be used only once.
*
* @param action
+ * action with an additional expiration timestamp
*/
public AuthCache(Protocol.ExpiringAction action) {
this.cachedAction = action;
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
index 8ef8f59f93..00b34ed3ea 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
@@ -15,6 +15,7 @@ import org.eclipse.jgit.nls.TranslationBundle;
/**
* Translation bundle for JGit LFS server
*/
+@SuppressWarnings("MissingSummary")
public class LfsText extends TranslationBundle {
/**