[google-docs-upload] r21 committed - - Fixed duplicate detection for files uploaded without conversion

2 views
Skip to first unread message

google-do...@googlecode.com

unread,
Apr 11, 2011, 7:28:17 PM4/11/11
to google-docs-u...@googlegroups.com
Revision: 21
Author: anton.be...@gmail.com
Date: Mon Apr 11 16:27:08 2011
Log: - Fixed duplicate detection for files uploaded without conversion
http://code.google.com/p/google-docs-upload/source/detail?r=21

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

=======================================
--- /dev/null
+++ /trunk/jars/google-docs-upload-1.4.6.jar Mon Apr 11 16:27:08 2011
File is too large to display a diff.
=======================================
--- /trunk/src/GoogleDocsUpload.java Wed Apr 6 16:11:48 2011
+++ /trunk/src/GoogleDocsUpload.java Mon Apr 11 16:27:08 2011
@@ -62,7 +62,7 @@
*
* @author Anton Beloglazov
* @since 03/09/2009
- * @version 1.4.5 07/04/2011
+ * @version 1.4.6 12/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.5",
+ "Google Docs Upload 1.4.6",
"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.5",
+ "Google Docs Upload 1.4.6",
"",
"Usage: java -jar google-docs-upload.jar",
"Usage: java -jar google-docs-upload.jar <path> --recursive",
@@ -435,10 +435,26 @@
// printLine(" - Skipped: the file size exceeds the limit");
// return null;
// }
-
- DocumentListEntry currentRemoteDoc =
documentListFindByTitle(getFileName(file), remoteDocs);
+
+ boolean convert = true;
+ if (isOptionWithoutConversion()) {
+ convert = false;
+ } else {
+ convert = isAllowedFormat(file);
+ if (!convert) {
+ printLine(" - Uploading without conversion");
+ }
+ }
+ String name = null;
+ if (convert) {
+ name = getFileName(file);
+ } else {
+ name = file.getName();
+ }
+
+ DocumentListEntry currentRemoteDoc = documentListFindByTitle(name,
remoteDocs);
boolean skip = false;
- if (currentRemoteDoc != null && !isOptionAddAll() &&
currentRemoteDoc.getType().equals(getFileType(file))) {
+ if (currentRemoteDoc != null && !isOptionAddAll() && (!convert ||
currentRemoteDoc.getType().equals(getFileType(file)))) {
boolean replace = false;

if (!isOptionSkipAll() && !isOptionReplaceAll()) {
@@ -483,23 +499,7 @@
cnt = 1;
}
for (int i = 0; i < cnt; i++) {
- try {
- boolean convert = true;
- if (isOptionWithoutConversion()) {
- convert = false;
- } else {
- convert = isAllowedFormat(file);
- if (!convert) {
- printLine(" - Uploading without conversion");
- }
- }
- String name = null;
- if (convert) {
- name = getFileName(file);
- } else {
- name = file.getName();
- }
-
+ try {
if (remoteFolder == null) {
return getDocumentList().uploadFile(file.getAbsolutePath(), name,
convert, isOptionHideAll());
} else {

Reply all
Reply to author
Forward
0 new messages