mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Merge branch 'develop' into add_cookie_based_session_support
This commit is contained in:
commit
0071a97e8b
@ -2,9 +2,10 @@ language: java
|
||||
jdk: oraclejdk7
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq libstdc++6:i386 lib32z1
|
||||
- curl -3L https://raw.github.com/embarkmobile/android-sdk-installer/version-1/android-sdk-installer
|
||||
| bash /dev/stdin --install=$COMPONENTS
|
||||
- sudo apt-get install -qq libstdc++6:i386 lib32z1 expect
|
||||
- export LICENSES="android-sdk-license-5be876d5|android-sdk-license-598b93a6"
|
||||
- curl -3L https://raw.github.com/embarkmobile/android-sdk-installer/version-2/android-sdk-installer
|
||||
| bash /dev/stdin --install=$COMPONENTS --accept=$LICENSES
|
||||
- source ~/.android-sdk-installer/env
|
||||
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 20M
|
||||
- emulator -avd test -no-skin -no-audio -no-window &
|
||||
@ -24,4 +25,4 @@ env:
|
||||
- secure: aF4U20Xlu/rfrbxCmoJAiGh1doYTAZ10UEDmajuinT+ZGSJLivuqD7DDY/00sI6IXWg+J1vL+7jJm4JSYusHPg38UHZ4q92k6RmZycW2ATUzZnGT54O5FRnY67MfVwgVpIMK9UOL/6NEciBHEjlIOL0wbKQiJB++1YtBZOQLGL4=
|
||||
- secure: N+ECSwNg8v2GsAFJ2y/tCiffauHDpN76zuFI2pDqf0fjmCtJZHu4BH5ArXBHjyHKmgn20a/8eZXcwJaH1HsJ80bo7vDJ2miShjGIQ90hPcdmUiB2XVJcew4f04CtvMDH5o7DRt4ykWArlbPL2rhVag0jotlSidolHBwRFnbDhDY=
|
||||
matrix:
|
||||
- COMPONENTS=build-tools-19.0.3,android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
|
||||
- COMPONENTS=build-tools-20.0.0,android-19,sys-img-armeabi-v7a-android-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
|
||||
|
@ -30,18 +30,20 @@ import org.apache.jackrabbit.webdav.MultiStatusResponse;
|
||||
import org.apache.jackrabbit.webdav.property.DavProperty;
|
||||
import org.apache.jackrabbit.webdav.property.DavPropertyName;
|
||||
import org.apache.jackrabbit.webdav.property.DavPropertySet;
|
||||
|
||||
|
||||
|
||||
import org.apache.jackrabbit.webdav.xml.Namespace;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
public class WebdavEntry {
|
||||
private String mName, mPath, mUri, mContentType, mEtag;
|
||||
private long mContentLength, mCreateTimestamp, mModifiedTimestamp;
|
||||
private static final String NAMESPACE_OC = "http://owncloud.org/ns";
|
||||
private static final String EXTENDED_PROPERTY_NAME_PERMISSIONS = "permissions";
|
||||
private static final String EXTENDED_PROPERTY_NAME_REMOTE_ID = "id";
|
||||
|
||||
public WebdavEntry(MultiStatusResponse ms, String splitElement) {
|
||||
private String mName, mPath, mUri, mContentType, mEtag, mPermissions, mRemoteId;
|
||||
private long mContentLength, mCreateTimestamp, mModifiedTimestamp;
|
||||
|
||||
public WebdavEntry(MultiStatusResponse ms, String splitElement) {
|
||||
resetData();
|
||||
if (ms.getStatus().length != 0) {
|
||||
mUri = ms.getHref();
|
||||
@ -106,6 +108,22 @@ public class WebdavEntry {
|
||||
mEtag = mEtag.substring(1, mEtag.length()-1);
|
||||
}
|
||||
|
||||
// OC permissions property <oc:permissions>
|
||||
prop = propSet.get(
|
||||
EXTENDED_PROPERTY_NAME_PERMISSIONS, Namespace.getNamespace(NAMESPACE_OC)
|
||||
);
|
||||
if (prop != null) {
|
||||
mPermissions = prop.getValue().toString();
|
||||
}
|
||||
|
||||
// OC remote id property <oc:id>
|
||||
prop = propSet.get(
|
||||
EXTENDED_PROPERTY_NAME_REMOTE_ID, Namespace.getNamespace(NAMESPACE_OC)
|
||||
);
|
||||
if (prop != null) {
|
||||
mRemoteId = prop.getValue().toString();
|
||||
}
|
||||
|
||||
} else {
|
||||
Log.e("WebdavEntry",
|
||||
"General fuckup, no status for webdav response");
|
||||
@ -152,8 +170,16 @@ public class WebdavEntry {
|
||||
return mEtag;
|
||||
}
|
||||
|
||||
public String permissions() {
|
||||
return mPermissions;
|
||||
}
|
||||
|
||||
public String remoteId() {
|
||||
return mRemoteId;
|
||||
}
|
||||
|
||||
private void resetData() {
|
||||
mName = mUri = mContentType = null;
|
||||
mName = mUri = mContentType = mPermissions = null; mRemoteId = null;
|
||||
mContentLength = mCreateTimestamp = mModifiedTimestamp = 0;
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class WebdavUtils {
|
||||
Date returnDate = null;
|
||||
for (int i = 0; i < DATETIME_FORMATS.length; ++i) {
|
||||
try {
|
||||
returnDate = new SimpleDateFormat (DATETIME_FORMATS[i]).parse(date);
|
||||
returnDate = new SimpleDateFormat (DATETIME_FORMATS[i], Locale.US).parse(date);
|
||||
return returnDate;
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
@ -163,6 +163,8 @@ public class ReadRemoteFolderOperation extends RemoteOperation {
|
||||
file.setMimeType(we.contentType());
|
||||
file.setModifiedTimestamp(we.modifiedTimestamp());
|
||||
file.setEtag(we.etag());
|
||||
file.setPermissions(we.permissions());
|
||||
file.setRemoteId(we.remoteId());
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
||||
private long mCreationTimestamp;
|
||||
private long mModifiedTimestamp;
|
||||
private String mEtag;
|
||||
private String mPermissions;
|
||||
private String mRemoteId;
|
||||
|
||||
/**
|
||||
* Getters and Setters
|
||||
@ -101,6 +103,22 @@ public class RemoteFile implements Parcelable, Serializable {
|
||||
this.mEtag = etag;
|
||||
}
|
||||
|
||||
public String getPermissions() {
|
||||
return mPermissions;
|
||||
}
|
||||
|
||||
public void setPermissions(String permissions) {
|
||||
this.mPermissions = permissions;
|
||||
}
|
||||
|
||||
public String getRemoteId() {
|
||||
return mRemoteId;
|
||||
}
|
||||
|
||||
public void setRemoteId(String remoteId) {
|
||||
this.mRemoteId = remoteId;
|
||||
}
|
||||
|
||||
public RemoteFile() {
|
||||
resetData();
|
||||
}
|
||||
@ -127,6 +145,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
||||
this.setMimeType(we.contentType());
|
||||
this.setModifiedTimestamp(we.modifiedTimestamp());
|
||||
this.setEtag(we.etag());
|
||||
this.setPermissions(we.permissions());
|
||||
this.setRemoteId(we.remoteId());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,6 +159,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
||||
mCreationTimestamp = 0;
|
||||
mModifiedTimestamp = 0;
|
||||
mEtag = null;
|
||||
mPermissions = null;
|
||||
mRemoteId = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -173,6 +195,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
||||
mCreationTimestamp = source.readLong();
|
||||
mModifiedTimestamp = source.readLong();
|
||||
mEtag = source.readString();
|
||||
mPermissions= source.readString();
|
||||
mRemoteId = source.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -188,6 +212,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
||||
dest.writeLong(mCreationTimestamp);
|
||||
dest.writeLong(mModifiedTimestamp);
|
||||
dest.writeString(mEtag);
|
||||
dest.writeString(mPermissions);
|
||||
dest.writeString(mRemoteId);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user