[google-docs-upload] r19 committed - - Fixed: some files could not be uploaded due to wrong mime types

1 view
Skip to first unread message

google-do...@googlecode.com

unread,
Apr 6, 2011, 8:33:35 AM4/6/11
to google-docs-u...@googlegroups.com
Revision: 19
Author: anton.be...@gmail.com
Date: Wed Apr 6 05:32:14 2011
Log: - Fixed: some files could not be uploaded due to wrong mime types
http://code.google.com/p/google-docs-upload/source/detail?r=19

Added:
/trunk/jars/google-docs-upload-1.4.4.jar
Modified:
/trunk/src/DocumentList.java
/trunk/src/GoogleDocsUpload.java

=======================================
--- /dev/null
+++ /trunk/jars/google-docs-upload-1.4.4.jar Wed Apr 6 05:32:14 2011
File is too large to display a diff.
=======================================
--- /trunk/src/DocumentList.java Sun Mar 20 15:27:32 2011
+++ /trunk/src/DocumentList.java Wed Apr 6 05:32:14 2011
@@ -24,6 +24,8 @@
import java.util.Map;
import java.util.Set;

+import javax.activation.MimetypesFileTypeMap;
+
import com.google.gdata.client.DocumentQuery;
import com.google.gdata.client.GoogleService;
import com.google.gdata.client.Query;
@@ -512,17 +514,8 @@
File file = new File(filepath);

DocumentEntry newDocument = new DocumentEntry();
-
- String mimeType = "";
- try {
- mimeType =
DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType();
- } catch (IllegalArgumentException e) {
- }
-
- if (mimeType != "") {
- newDocument.setFile(file, mimeType);
- }
-
+ newDocument.setFile(file, new
MimetypesFileTypeMap().getContentType(file));
+
newDocument.setTitle(new PlainTextConstruct(title));
newDocument.setHidden(hidden);

@@ -556,16 +549,7 @@
File file = new File(filepath);

DocumentEntry newDocument = new DocumentEntry();
-
- String mimeType = "";
- try {
- mimeType =
DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType();
- } catch (IllegalArgumentException e) {
- }
-
- if (mimeType != "") {
- newDocument.setFile(file, mimeType);
- }
+ newDocument.setFile(file, new
MimetypesFileTypeMap().getContentType(file));

newDocument.setTitle(new PlainTextConstruct(title));
newDocument.setHidden(hidden);
=======================================
--- /trunk/src/GoogleDocsUpload.java Sun Mar 20 15:27:32 2011
+++ /trunk/src/GoogleDocsUpload.java Wed Apr 6 05:32:14 2011
@@ -62,7 +62,7 @@
*
* @author Anton Beloglazov
* @since 03/09/2009
- * @version 1.4.3 21/03/2011
+ * @version 1.4.4 06/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.3",
+ "Google Docs Upload 1.4.4",
"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.3",
+ "Google Docs Upload 1.4.4",
"",
"Usage: java -jar google-docs-upload.jar",
"Usage: java -jar google-docs-upload.jar <path> --recursive",

Reply all
Reply to author
Forward
0 new messages