Permalink
Browse files

Fixes bug that prevents uploading of large files

  • Loading branch information...
1 parent 2bcfa03 commit 20f216611818496e3b5e58db27ca1ff8a99e4616 @jamessanders committed Sep 24, 2012
View
@@ -16,12 +16,19 @@
<artifactId>jopt-simple</artifactId>
<version>4.3</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.2.1</version>
+ </dependency>
+
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
- <version>1.2.15</version>
- <scope>compile</scope>
+ <version>1.3.20</version>
</dependency>
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -144,11 +144,11 @@ public long lastModified () {
return file.lastModified();
}
- public float getSize() {
+ public long getSize() {
return file.length();
}
- public void setSize(float size) {
+ public void setSize(long size) {
}
@@ -19,8 +19,8 @@
public String toString();
public Boolean finishWrite();
public long lastModified();
- public float getSize();
- public void setSize(float size);
+ public long getSize();
+ public void setSize(long size);
public void delete();
// File Properties
@@ -9,6 +9,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
/**
@@ -178,7 +179,12 @@ public void delete() {
public long lastModified() {
if (s3ObjectSummary == null) {
- return 0;
+ Date lastModifed = getS3Metadata().getLastModified();
+ if (lastModifed != null) {
+ return lastModifed.getTime();
+ } else {
+ return 0;
+ }
} else {
return s3ObjectSummary.getLastModified().getTime();
}
@@ -196,16 +202,16 @@ public ObjectMetadata getS3Metadata() {
}
- public float getSize() {
+ public long getSize() {
if (s3ObjectSummary != null) {
return s3ObjectSummary.getSize();
} else {
return getS3Metadata().getContentLength();
}
}
- public void setSize(float size) {
- getS3Metadata().setContentLength((long)size);
+ public void setSize(long size) {
+ getS3Metadata().setContentLength(size);
}
public String getMimeType() {

0 comments on commit 20f2166

Please sign in to comment.