import java.util.Locale;\r
\r
import com.owncloud.android.MainApp;\r
-import com.owncloud.android.lib.common.OwnCloudAccount;\r
import com.owncloud.android.lib.common.accounts.AccountTypeUtils;\r
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;\r
import com.owncloud.android.lib.common.utils.Log_OC;\r
if (accountName != null) {\r
Account[] ocAccounts = AccountManager.get(context).getAccountsByType(\r
MainApp.getAccountType());\r
- boolean found = false;\r
+ boolean found;\r
for (Account account : ocAccounts) {\r
found = (account.name.equals(accountName));\r
if (found) {\r
if (isOAuth) {\r
accountMgr.setUserData(newAccount, Constants.KEY_SUPPORTS_OAUTH2, "TRUE");\r
}\r
- /* TODO - study if it's possible to run this method in a background thread to copy the authToken\r
- if (isOAuth || isSaml) {\r
- accountMgr.setAuthToken(newAccount, mAuthTokenType, mAuthToken);\r
- }\r
- */\r
+ /* TODO - study if it's possible to run this method in a background thread to copy the authToken\r
+ if (isOAuth || isSaml) {\r
+ accountMgr.setAuthToken(newAccount, mAuthTokenType, mAuthToken);\r
+ }\r
+ */\r
\r
// don't forget the account saved in preferences as the current one\r
- if (currentAccount != null && currentAccount.name.equals(account.name)) {\r
+ if (currentAccount.name.equals(account.name)) {\r
AccountUtils.setCurrentOwnCloudAccount(context, newAccountName);\r
}\r
\r
// remove the old account\r
- accountMgr.removeAccount(account, null, null); // will assume it succeeds, not a big deal otherwise\r
+ accountMgr.removeAccount(account, null, null);\r
+ // will assume it succeeds, not a big deal otherwise\r
\r
} else {\r
// servers which base URL is in the root of their domain need no change\r
\r
// at least, upgrade account version\r
Log_OC.d(TAG, "Setting version " + ACCOUNT_VERSION + " to " + newAccountName);\r
- accountMgr.setUserData(newAccount, Constants.KEY_OC_ACCOUNT_VERSION, Integer.toString(ACCOUNT_VERSION));\r
+ accountMgr.setUserData(\r
+ newAccount, Constants.KEY_OC_ACCOUNT_VERSION, Integer.toString(ACCOUNT_VERSION)\r
+ );\r
\r
}\r
}\r
* in the system AccountManager\r
*/\r
public static OwnCloudVersion getServerVersion(Account account) {\r
+ OwnCloudVersion serverVersion = null;\r
if (account != null) {\r
AccountManager accountMgr = AccountManager.get(MainApp.getAppContext());\r
String serverVersionStr = accountMgr.getUserData(account, Constants.KEY_OC_VERSION);\r
- return new OwnCloudVersion(serverVersionStr);\r
+ if (serverVersionStr != null) {\r
+ serverVersion = new OwnCloudVersion(serverVersionStr);\r
+ }\r
}\r
- return null;\r
+ return serverVersion;\r
}\r
\r
}\r
import android.view.View;\r
import android.view.View.OnFocusChangeListener;\r
import android.view.View.OnTouchListener;\r
-import android.view.Window;\r
import android.view.inputmethod.EditorInfo;\r
import android.webkit.HttpAuthHandler;\r
import android.webkit.SslErrorHandler;\r
if (mAccount != null) {\r
mServerInfo.mBaseUrl = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_BASE_URL);\r
// TODO do next in a setter for mBaseUrl\r
- mServerInfo.mIsSslConn = mServerInfo.mBaseUrl.startsWith("https://"); \r
- String ocVersion = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);\r
- if (ocVersion != null) {\r
- mServerInfo.mVersion = new OwnCloudVersion(ocVersion);\r
- }\r
+ mServerInfo.mIsSslConn = mServerInfo.mBaseUrl.startsWith("https://");\r
+ mServerInfo.mVersion = AccountUtils.getServerVersion(mAccount);\r
} else {\r
mServerInfo.mBaseUrl = getString(R.string.server_url).trim();\r
mServerInfo.mIsSslConn = mServerInfo.mBaseUrl.startsWith("https://");\r
* intended to defer the processing of the redirection caught in \r
* {@link #onNewIntent(Intent)} until {@link #onResume()} \r
* \r
- * See {@link #onSaveInstanceState(Bundle)}\r
+ * See {@link super#onSaveInstanceState(Bundle)}\r
*/\r
@Override\r
protected void onSaveInstanceState(Bundle outState) {\r
if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_4_0_AND_LATER)){\r
url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_4_0_AND_LATER.length());\r
}\r
- return (url != null ? url : "");\r
+ return url;\r
}\r
\r
\r
}\r
\r
\r
- private void getRemoteUserNameOperation(String sessionCookie, boolean followRedirects) {\r
+ private void getRemoteUserNameOperation(String sessionCookie) {\r
\r
Intent getUserNameIntent = new Intent();\r
getUserNameIntent.setAction(OperationsService.ACTION_GET_USER_NAME);\r
if (sessionCookie != null && sessionCookie.length() > 0) {\r
Log_OC.d(TAG, "Successful SSO - time to save the account");\r
mAuthToken = sessionCookie;\r
- getRemoteUserNameOperation(sessionCookie, true);\r
+ getRemoteUserNameOperation(sessionCookie);\r
Fragment fd = getSupportFragmentManager().findFragmentByTag(SAML_DIALOG_TAG);\r
if (fd != null && fd instanceof DialogFragment) {\r
Dialog d = ((DialogFragment)fd).getDialog();\r
X509Certificate x509Certificate, SslError error, SslErrorHandler handler\r
) {\r
// Show a dialog with the certificate info\r
- SslUntrustedCertDialog dialog = null;\r
+ SslUntrustedCertDialog dialog;\r
if (x509Certificate == null) {\r
dialog = SslUntrustedCertDialog.newInstanceForEmptySslError(error, handler);\r
} else {\r
\r
doOnResumeAndBound();\r
\r
- } else {\r
- return;\r
}\r
\r
}\r
\r
/**\r
* Create and show dialog for request authentication to the user\r
- * @param webView\r
- * @param handler\r
+ * @param webView Web view to emebd into the authentication dialog.\r
+ * @param handler Object responsible for catching and recovering HTTP authentication fails.\r
*/\r
public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
\r
import org.apache.commons.httpclient.methods.GetMethod;
import android.accounts.Account;
-import android.accounts.AccountManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
+import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
-import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.ui.adapter.DiskLruImageCache;
private static final String TAG = ThumbnailsCacheManager.class.getSimpleName();
private static final String CACHE_FOLDER = "thumbnailCache";
- private static final String MINOR_SERVER_VERSION_FOR_THUMBS = "7.8.0";
-
+
private static final Object mThumbnailsDiskCacheLock = new Object();
private static DiskLruImageCache mThumbnailCache = null;
private static boolean mThumbnailCacheStarting = true;
private static final CompressFormat mCompressFormat = CompressFormat.JPEG;
private static final int mCompressQuality = 70;
private static OwnCloudClient mClient = null;
- private static String mServerVersion = null;
public static Bitmap mDefaultImg =
BitmapFactory.decodeResource(
while (mThumbnailCacheStarting) {
try {
mThumbnailsDiskCacheLock.wait();
- } catch (InterruptedException e) {}
+ } catch (InterruptedException e) {
+ Log_OC.e(TAG, "Wait in mThumbnailsDiskCacheLock was interrupted", e);
+ }
}
if (mThumbnailCache != null) {
- return (Bitmap) mThumbnailCache.getBitmap(key);
+ return mThumbnailCache.getBitmap(key);
}
}
return null;
try {
if (mAccount != null) {
- AccountManager accountMgr = AccountManager.get(MainApp.getAppContext());
-
- mServerVersion = accountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);
OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount,
MainApp.getAppContext());
mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
thumbnail = doOCFileInBackground();
} else if (mFile instanceof File) {
thumbnail = doFileInBackground();
- } else {
- // do nothing
+ //} else { do nothing
}
}catch(Throwable t){
bitmap = null;
}
- if (mImageViewReference != null && bitmap != null) {
+ if (bitmap != null) {
final ImageView imageView = mImageViewReference.get();
final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
- if (this == bitmapWorkerTask && imageView != null) {
+ if (this == bitmapWorkerTask) {
String tagId = "";
if (mFile instanceof OCFile){
tagId = String.valueOf(((OCFile)mFile).getFileId());
} else if (mFile instanceof File){
- tagId = String.valueOf(((File)mFile).hashCode());
+ tagId = String.valueOf(mFile.hashCode());
}
if (String.valueOf(imageView.getTag()).equals(tagId)) {
imageView.setImageBitmap(bitmap);
private int getThumbnailDimension(){
// Converts dp to pixel
Resources r = MainApp.getAppContext().getResources();
- return (int) Math.round(r.getDimension(R.dimen.file_icon_size_grid));
+ return Math.round(r.getDimension(R.dimen.file_icon_size_grid));
}
private Bitmap doOCFileInBackground() {
- Bitmap thumbnail = null;
OCFile file = (OCFile)mFile;
final String imageKey = String.valueOf(file.getRemoteId());
// Check disk cache in background thread
- thumbnail = getBitmapFromDiskCache(imageKey);
+ Bitmap thumbnail = getBitmapFromDiskCache(imageKey);
// Not found in disk cache
if (thumbnail == null || file.needsUpdateThumbnail()) {
} else {
// Download thumbnail from server
- if (mClient != null && mServerVersion != null) {
- OwnCloudVersion serverOCVersion = new OwnCloudVersion(mServerVersion);
- if (serverOCVersion.compareTo(
- new OwnCloudVersion(MINOR_SERVER_VERSION_FOR_THUMBS)) >= 0) {
+ OwnCloudVersion serverOCVersion = AccountUtils.getServerVersion(mAccount);
+ if (mClient != null && serverOCVersion != null) {
+ if (serverOCVersion.supportsRemoteThumbnails()) {
try {
- int status = -1;
-
String uri = mClient.getBaseUri() + "" +
"/index.php/apps/files/api/v1/thumbnail/" +
px + "/" + px + Uri.encode(file.getRemotePath(), "/");
Log_OC.d("Thumbnail", "URI: " + uri);
GetMethod get = new GetMethod(uri);
- status = mClient.executeMethod(get);
+ int status = mClient.executeMethod(get);
if (status == HttpStatus.SC_OK) {
// byte[] bytes = get.getResponseBody();
// Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0,
}
private Bitmap doFileInBackground() {
- Bitmap thumbnail = null;
File file = (File)mFile;
final String imageKey = String.valueOf(file.hashCode());
// Check disk cache in background thread
- thumbnail = getBitmapFromDiskCache(imageKey);
+ Bitmap thumbnail = getBitmapFromDiskCache(imageKey);
// Not found in disk cache
if (thumbnail == null) {
import org.apache.http.protocol.HTTP;
import android.accounts.Account;
-import android.accounts.AccountManager;
import android.content.Intent;
import android.net.Uri;
import android.support.v4.app.DialogFragment;
import android.widget.Toast;
import com.owncloud.android.R;
+import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
-import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
Intent intentForSavedMimeType = new Intent(Intent.ACTION_VIEW);
intentForSavedMimeType.setDataAndType(Uri.parse("file://"+ encodedStoragePath), file.getMimetype());
- intentForSavedMimeType.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
+ intentForSavedMimeType.setFlags(
+ Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION
+ );
Intent intentForGuessedMimeType = null;
if (storagePath.lastIndexOf('.') >= 0) {
- String guessedMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(storagePath.substring(storagePath.lastIndexOf('.') + 1));
+ String guessedMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(
+ storagePath.substring(storagePath.lastIndexOf('.') + 1)
+ );
if (guessedMimeType != null && !guessedMimeType.equals(file.getMimetype())) {
intentForGuessedMimeType = new Intent(Intent.ACTION_VIEW);
intentForGuessedMimeType.setDataAndType(Uri.parse("file://"+ encodedStoragePath), guessedMimeType);
- intentForGuessedMimeType.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
+ intentForGuessedMimeType.setFlags(
+ Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION
+ );
}
}
- Intent chooserIntent = null;
+ Intent chooserIntent;
if (intentForGuessedMimeType != null) {
chooserIntent = Intent.createChooser(intentForGuessedMimeType, mFileActivity.getString(R.string.actionbar_open_with));
} else {
} else {
// Show a Message
- Toast t = Toast.makeText(mFileActivity, mFileActivity.getString(R.string.share_link_no_support_share_api), Toast.LENGTH_LONG);
+ Toast t = Toast.makeText(
+ mFileActivity, mFileActivity.getString(R.string.share_link_no_support_share_api), Toast.LENGTH_LONG
+ );
t.show();
}
}
*/
public boolean isSharedSupported() {
if (mFileActivity.getAccount() != null) {
- AccountManager accountManager = AccountManager.get(mFileActivity);
-
- String version = accountManager.getUserData(mFileActivity.getAccount(), Constants.KEY_OC_VERSION);
- return (new OwnCloudVersion(version)).isSharedSupported();
+ OwnCloudVersion serverVersion = AccountUtils.getServerVersion(mFileActivity.getAccount());
+ return (serverVersion != null && serverVersion.isSharedSupported());
}
return false;
}
*/
public boolean isVersionWithForbiddenCharacters() {
if (mFileActivity.getAccount() != null) {
- AccountManager accountManager = AccountManager.get(mFileActivity);
-
- String version = accountManager.getUserData(mFileActivity.getAccount(),
- Constants.KEY_OC_VERSION);
- return (new OwnCloudVersion(version)).isVersionWithForbiddenCharacters();
+ OwnCloudVersion serverVersion = AccountUtils.getServerVersion(mFileActivity.getAccount());
+ return (serverVersion != null && serverVersion.isVersionWithForbiddenCharacters());
}
return false;
}
import android.support.v4.app.NotificationCompat;
import android.webkit.MimeTypeMap;
-import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
-import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
private Account mLastAccount = null;
private FileDataStorageManager mStorageManager;
- private ConcurrentMap<String, UploadFileOperation> mPendingUploads = new ConcurrentHashMap<String, UploadFileOperation>();
+ private ConcurrentMap<String, UploadFileOperation> mPendingUploads =
+ new ConcurrentHashMap<String, UploadFileOperation>();
private UploadFileOperation mCurrentUpload = null;
private NotificationManager mNotificationManager;
public static String getUploadFinishMessage() {
- return FileUploader.class.getName().toString() + UPLOAD_FINISH_MESSAGE;
+ return FileUploader.class.getName() + UPLOAD_FINISH_MESSAGE;
}
/**
if (uploadType == UPLOAD_SINGLE_FILE) {
if (intent.hasExtra(KEY_FILE)) {
- files = new OCFile[] { (OCFile) intent.getParcelableExtra(KEY_FILE) };
+ files = new OCFile[] { intent.getParcelableExtra(KEY_FILE) };
} else {
localPaths = new String[] { intent.getStringExtra(KEY_LOCAL_FILE) };
files = new OCFile[localPaths.length];
for (int i = 0; i < localPaths.length; i++) {
files[i] = obtainNewOCFileToUpload(remotePaths[i], localPaths[i],
- ((mimeTypes != null) ? mimeTypes[i] : (String) null), storageManager);
+ ((mimeTypes != null) ? mimeTypes[i] : null), storageManager);
if (files[i] == null) {
// TODO @andomaex add failure Notification
return Service.START_NOT_STICKY;
}
}
- AccountManager aMgr = AccountManager.get(this);
- String version = aMgr.getUserData(account, Constants.KEY_OC_VERSION);
- OwnCloudVersion ocv = new OwnCloudVersion(version);
+ OwnCloudVersion ocv = AccountUtils.getServerVersion(account);
boolean chunked = FileUploader.chunkedUploadIsSupported(ocv);
AbstractList<String> requestedUploads = new Vector<String>();
* Map of listeners that will be reported about progress of uploads from a
* {@link FileUploaderBinder} instance
*/
- private Map<String, OnDatatransferProgressListener> mBoundListeners = new HashMap<String, OnDatatransferProgressListener>();
+ private Map<String, OnDatatransferProgressListener> mBoundListeners =
+ new HashMap<String, OnDatatransferProgressListener>();
/**
* Cancels a pending or current upload of a remote file.
* @param file A file in the queue of pending uploads
*/
public void cancel(Account account, OCFile file) {
- UploadFileOperation upload = null;
+ UploadFileOperation upload;
synchronized (mPendingUploads) {
upload = mPendingUploads.remove(buildRemoteName(account, file));
}
notifyUploadStart(mCurrentUpload);
- RemoteOperationResult uploadResult = null, grantResult = null;
+ RemoteOperationResult uploadResult = null, grantResult;
try {
/// prepare client object to send requests to the ownCloud server
mPendingUploads.remove(uploadKey);
Log_OC.i(TAG, "Remove CurrentUploadItem from pending upload Item Map.");
}
- if (uploadResult.isException()) {
+ if (uploadResult != null && uploadResult.isException()) {
// enforce the creation of a new client object for next uploads;
// this grant that a new socket will be created in the future if
// the current exception is due to an abrupt lose of network connection
int tickerId = (uploadResult.isSuccess()) ? R.string.uploader_upload_succeeded_ticker :
R.string.uploader_upload_failed_ticker;
- String content = null;
+ String content;
// check credentials error
boolean needsToUpdateCredentials = (
/**
* Checks if content provider, using the content:// scheme, returns a file with mime-type
* 'application/pdf' but file has not extension
- * @param localPath
- * @param mimeType
+ * @param localPath Full path to a file in the local file system.
+ * @param mimeType MIME type of the file.
* @return true if is needed to add the pdf file extension to the file
*/
private boolean isPdfFileFromContentProviderWithoutExtension(String localPath,
/**
* Remove uploads of an account
- * @param accountName
+ * @param accountName Name of an OC account
*/
private void cancelUploadForAccount(String accountName){
// this can be slow if there are many uploads :(
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
import com.owncloud.android.lib.common.OwnCloudCredentials;
import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;
-import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.ShareType;
+import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.operations.CreateFolderOperation;
return true;
//Log_OC.wtf(TAG, "Sending callback later");
} else {
- if (!mServiceHandler.mPendingOperations.isEmpty()) {
- return true;
- } else {
- return false;
- }
- //Log_OC.wtf(TAG, "Not finished yet");
+ return (!mServiceHandler.mPendingOperations.isEmpty());
}
}
mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
getClientFor(ocAccount, mService);
- AccountManager am = AccountManager.get(mService.getApplicationContext());
- String version = am.getUserData(mLastTarget.mAccount,
- AccountUtils.Constants.KEY_OC_VERSION);
+ OwnCloudVersion version = com.owncloud.android.authentication.AccountUtils.getServerVersion(
+ mLastTarget.mAccount
+ );
mOwnCloudClient.setOwnCloudVersion(version);
mStorageManager = new FileDataStorageManager(
/**
* Creates an empty details fragment.
*
- * It's necessary to keep a public constructor without parameters; the system uses it when tries to reinstantiate a fragment automatically.
+ * It's necessary to keep a public constructor without parameters; the system uses it when tries
+ * to reinstantiate a fragment automatically.
*/
public FileDetailFragment() {
super();
mLayout = R.layout.file_details_fragment;
}
- View view = null;
- view = inflater.inflate(mLayout, null);
- mView = view;
+ mView = inflater.inflate(mLayout, null);
if (mLayout == R.layout.file_details_fragment) {
mView.findViewById(R.id.fdKeepInSync).setOnClickListener(this);
mProgressListener = new ProgressListener(progressBar);
mView.findViewById(R.id.fdCancelBtn).setOnClickListener(this);
}
-
+
updateFileDetails(false, false);
- return view;
+ return mView;
}
@Override
setFilename(file.getFileName());
setFiletype(file.getMimetype(), file.getFileName());
setFilesize(file.getFileLength());
- if(ocVersionSupportsTimeCreated()){
- setTimeCreated(file.getCreationTimestamp());
- }
-
+
setTimeModified(file.getModificationTimestamp());
CheckBox cb = (CheckBox)getView().findViewById(R.id.fdKeepInSync);
/**
* Updates the MIME type in view
- * @param mimetype to set
- * @param filename
+ * @param mimetype MIME type to set
+ * @param filename Name of the file, to deduce the icon to use in case the MIME type is not precise enough
*/
private void setFiletype(String mimetype, String filename) {
TextView tv = (TextView) getView().findViewById(R.id.fdType);
}
/**
- * Updates the time that the file was created in view
- * @param milliseconds Unix time to set
- */
- private void setTimeCreated(long milliseconds){
- TextView tv = (TextView) getView().findViewById(R.id.fdCreated);
- TextView tvLabel = (TextView) getView().findViewById(R.id.fdCreatedLabel);
- if(tv != null){
- tv.setText(DisplayUtils.unixTimeToHumanReadable(milliseconds));
- tv.setVisibility(View.VISIBLE);
- tvLabel.setVisibility(View.VISIBLE);
- }
- }
-
- /**
* Updates the time that the file was last modified
* @param milliseconds Unix time to set
*/
}
- /**
- * In ownCloud 3.X.X and 4.X.X there is a bug that SabreDAV does not return
- * the time that the file was created. There is a chance that this will
- * be fixed in future versions. Use this method to check if this version of
- * ownCloud has this fix.
- * @return True, if ownCloud the ownCloud version is supporting creation time
- */
- private boolean ocVersionSupportsTimeCreated(){
- /*if(mAccount != null){
- AccountManager accManager = (AccountManager) getActivity()
- .getSystemService(Context.ACCOUNT_SERVICE);
- OwnCloudVersion ocVersion = new OwnCloudVersion(accManager
- .getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));
- if(ocVersion.compareTo(new OwnCloudVersion(0x030000)) < 0) {
- return true;
- }
- }*/
- return false;
- }
-
-
public void listenForTransferProgress() {
if (mProgressListener != null) {
if (mContainerActivity.getFileDownloaderBinder() != null) {
mLastPercent = percent;
}
- };
+ }
}