Skip to content

Commit

Permalink
Update to Jenkins 1.619; Java 7; new maintainers.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreystroilov committed Jul 9, 2015
1 parent ad84733 commit cc50b85
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.521</version>
<version>1.619</version>
</parent>


Expand Down Expand Up @@ -53,6 +53,10 @@
<id>tcnghia</id>
<name>Nghia Tran</name>
</developer>
<developer>
<id>astroilov</id>
<name>Andrey Stroilov</name>
</developer>
</developers>

<scm>
Expand Down Expand Up @@ -82,8 +86,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import javax.annotation.Nullable;

import org.apache.commons.io.FilenameUtils;
import org.jenkinsci.remoting.RoleChecker;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.jenkins.plugins.storage.AbstractUploadDescriptor.GCS_SCHEME;
Expand Down Expand Up @@ -350,6 +351,13 @@ public Void call() throws UploadException {
remoteCredentials, uploads, listener);
return (Void) null;
}

@Override
public void checkRoles(RoleChecker checker)
throws SecurityException {
// We know by definition that this is the correct role;
// the callable exists only in this method context.
}

This comment has been minimized.

Copy link
@jglick

jglick Aug 3, 2015

Member

Probably wrong. See jenkinsci/remoting#56.

});

// We can't do this over the wire, so do it in bulk here
Expand Down Expand Up @@ -453,8 +461,9 @@ private String detectMIMEType(String filename) {
*/
private void performUploadWithRetry(Executor executor, Storage service,
Bucket bucket, StorageObject object, FilePath include)
throws ExecutorException, IOException {
IOException lastException = null;
throws ExecutorException, IOException, InterruptedException {
IOException lastIOException = null;
InterruptedException lastInterruptedException = null;
for (int i = 0; i < module.getInsertRetryCount(); ++i) {
try {
// Create the insertion operation with the decorated object and
Expand All @@ -475,7 +484,10 @@ private void performUploadWithRetry(Executor executor, Storage service,
return;
} catch (IOException e) {
logger.log(SEVERE, Messages.AbstractUpload_UploadError(i), e);
lastException = e;
lastIOException = e;
} catch (InterruptedException e) {
logger.log(SEVERE, Messages.AbstractUpload_UploadError(i), e);
lastInterruptedException = e;
}

// Pause before we retry
Expand All @@ -484,7 +496,10 @@ private void performUploadWithRetry(Executor executor, Storage service,

// NOTE: We only reach here along paths that encountered an exception.
// The "happy path" returns from the "try" statement above.
throw checkNotNull(lastException);
if (lastIOException != null) {
throw lastIOException;
}
throw checkNotNull(lastInterruptedException);
}

// Fetch the default object ACL for this bucket. Return an empty list if
Expand Down

0 comments on commit cc50b85

Please sign in to comment.