Added:
/trunk/jars/google-docs-upload-1.4.5.jar
Modified:
/trunk/src/DocumentList.java
/trunk/src/GoogleDocsUpload.java
=======================================
--- /dev/null
+++ /trunk/jars/google-docs-upload-1.4.5.jar Wed Apr 6 16:11:48 2011
File is too large to display a diff.
=======================================
--- /trunk/src/DocumentList.java Wed Apr 6 05:32:14 2011
+++ /trunk/src/DocumentList.java Wed Apr 6 16:11:48 2011
@@ -514,7 +514,8 @@
File file = new File(filepath);
DocumentEntry newDocument = new DocumentEntry();
- newDocument.setFile(file, new
MimetypesFileTypeMap().getContentType(file));
+
+ newDocument.setFile(file, getMimeType(file));
newDocument.setTitle(new PlainTextConstruct(title));
newDocument.setHidden(hidden);
@@ -549,7 +550,8 @@
File file = new File(filepath);
DocumentEntry newDocument = new DocumentEntry();
- newDocument.setFile(file, new
MimetypesFileTypeMap().getContentType(file));
+
+ newDocument.setFile(file, getMimeType(file));
newDocument.setTitle(new PlainTextConstruct(title));
newDocument.setHidden(hidden);
@@ -569,12 +571,26 @@
}
File file = new File(filepath);
- String mimeType =
DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType();
-
- entry.setFile(file, mimeType);
+
+ entry.setFile(file, getMimeType(file));
+
entry.setHidden(hidden);
return entry.updateMedia(true);
}
+
+ public String getMimeType(File file) {
+ String mimeType = "";
+ try {
+ mimeType =
DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType();
+ } catch (IllegalArgumentException e) {
+ }
+
+ if (mimeType == "") {
+ mimeType = new MimetypesFileTypeMap().getContentType(file);
+ }
+
+ return mimeType;
+ }
/**
* Trash an object.
=======================================
--- /trunk/src/GoogleDocsUpload.java Wed Apr 6 05:32:14 2011
+++ /trunk/src/GoogleDocsUpload.java Wed Apr 6 16:11:48 2011
@@ -62,7 +62,7 @@
*
* @author Anton Beloglazov
* @since 03/09/2009
- * @version 1.4.4 06/04/2011
+ * @version 1.4.5 07/04/2011
*/
public class GoogleDocsUpload {
@@ -130,14 +130,14 @@
/** Welcome message, introducing the program. */
protected static final String[] WELCOME_MESSAGE = { "",
- "Google Docs Upload 1.4.4",
+ "Google Docs Upload 1.4.5",
"Using this tool, you can batch upload your documents to a Google Docs
account preserving folder structure.",
"Type 'help' for a list of parameters.", ""
};
/** The message for displaying the usage parameters. */
protected static final String[] USAGE_MESSAGE = { "",
- "Google Docs Upload 1.4.4",
+ "Google Docs Upload 1.4.5",
"",
"Usage: java -jar google-docs-upload.jar",
"Usage: java -jar google-docs-upload.jar <path> --recursive",