Skip to content

Commit

Permalink
remove unused variables #3921
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Aug 15, 2017
1 parent c2f3f05 commit b626cd7
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ public S3AccessIO(T dvObject, DataAccessRequest req) {
private AmazonS3 s3 = null;
private String bucketName = System.getProperty("dataverse.files.s3-bucket-name");
private String key;
private String s3FileName;
private String storageIdentifier;

@Override
public void open(DataAccessOption... options) throws IOException {
Expand All @@ -106,19 +104,20 @@ public void open(DataAccessOption... options) throws IOException {
}

if (dvObject instanceof DataFile) {
String storageIdentifier = dvObject.getStorageIdentifier();

DataFile dataFile = this.getDataFile();
key = this.getDataFile().getOwner().getAuthority() + "/" + this.getDataFile().getOwner().getIdentifier();
key = dataFile.getOwner().getAuthority() + "/" + this.getDataFile().getOwner().getIdentifier();

if (req != null && req.getParameter("noVarHeader") != null) {
this.setNoVarHeader(true);
}

if (dataFile.getStorageIdentifier() == null || "".equals(dataFile.getStorageIdentifier())) {
if (storageIdentifier == null || "".equals(storageIdentifier)) {
throw new FileNotFoundException("Data Access: No local storage identifier defined for this datafile.");
}

if (isReadAccess) {
storageIdentifier = dvObject.getStorageIdentifier();
if (storageIdentifier.startsWith("s3://")) {
bucketName = storageIdentifier.substring(storageIdentifier.indexOf(":") + 3, storageIdentifier.lastIndexOf(":"));
key += "/" + storageIdentifier.substring(storageIdentifier.lastIndexOf(":") + 1);
Expand Down Expand Up @@ -149,7 +148,6 @@ public void open(DataAccessOption... options) throws IOException {
}

} else if (isWriteAccess) {
storageIdentifier = dvObject.getStorageIdentifier();
if (storageIdentifier.startsWith("s3://")) {
key += "/" + storageIdentifier.substring(storageIdentifier.lastIndexOf(":") + 1);
} else {
Expand Down

0 comments on commit b626cd7

Please sign in to comment.