+ public UploadFileOperation( Account account,
+ String localPath,
+ String remotePath,
+ String mimeType,
+ boolean isInstant,
+ boolean forceOverwrite) {
+ if (account == null)
+ throw new IllegalArgumentException("Illegal null account in UploadFileOperation creation");
+ if (localPath == null || localPath.length() <= 0)
+ throw new IllegalArgumentException("Illegal null or empty localPath in UploadFileOperation creation");
+ if (remotePath == null || remotePath.length() <= 0)
+ throw new IllegalArgumentException("Illegal null or empty remotePath in UploadFileOperation creation");
+
+ mAccount = account;
+ mLocalPath = localPath;
+ mRemotePath = remotePath;
+ mMimeType = mimeType;
+ if (mMimeType == null || mMimeType.length() <= 0) {
+ try {
+ mMimeType = MimeTypeMap.getSingleton()
+ .getMimeTypeFromExtension(
+ localPath.substring(localPath.lastIndexOf('.') + 1));
+ } catch (IndexOutOfBoundsException e) {
+ Log.e(TAG, "Trying to find out MIME type of a file without extension: " + localPath);
+ }
+ }
+ if (mMimeType == null) {
+ mMimeType = "application/octet-stream";
+ }
+ mIsInstant = isInstant;
+ mForceOverwrite = forceOverwrite;
+ }
+
+
+ public Account getAccount() {
+ return mAccount;
+ }
+