/** * Reconstruct from parcel * * @param source The source parcel */ protected RemoteFile(Parcel source) { readFromParcel(source); }
public RemoteFile() { resetData(); }
public RemoteFile(final Response davResource, String userId) { this(getRemotePathFromUrl(davResource.getHref(), userId)); final List<Property> properties = davResource.getProperties(); this.setCreationTimestamp( Long.parseLong(((CreationDate) property).getCreationDate())); if(property instanceof GetContentLength) this.setLength(((GetContentLength) property).getContentLength()); if(property instanceof GetContentType) this.setMimeType(((GetContentType) property).getType()); if(property instanceof GetLastModified) this.setModifiedTimestamp(((GetLastModified) property).getLastModified()); if(property instanceof GetETag) this.setEtag(((GetETag) property).getETag()); if(property instanceof OCPermissions) this.setPermissions(((OCPermissions) property).getPermission()); if(property instanceof OCId) this.setRemoteId(((OCId) property).getId()); if(property instanceof OCSize) this.setSize(((OCSize) property).getSize()); if(property instanceof QuotaUsedBytes) this.setQuotaUsedBytes( BigDecimal.valueOf(((QuotaUsedBytes) property).getQuotaUsedBytes())); if(property instanceof QuotaAvailableBytes) this.setQuotaAvailableBytes( BigDecimal.valueOf(((QuotaAvailableBytes) property).getQuotaAvailableBytes())); if(property instanceof OCPrivatelink) this.setPrivateLink(((OCPrivatelink) property).getLink());
new RemoteFile(propfindMethod.getRoot(), AccountUtils.getUserId(mAccount, mContext)) ); RemoteFile file = new RemoteFile(resource, AccountUtils.getUserId(mAccount, mContext)); mFolderAndFiles.add(file);
public View getView(int position, View convertView, ViewGroup parent) { TextView textView = (TextView)super.getView(position, convertView, parent); textView.setText(getItem(position).getRemotePath()); return textView; } }
|| status == HttpConstants.HTTP_OK) { final RemoteFile file = new RemoteFile(propfind.getRoot(), AccountUtils.getUserId(mAccount, mContext));
/** * Create new {@link RemoteFile} with given path. * * The path received must be URL-decoded. Path separator must be OCFile.PATH_SEPARATOR, and it must be the first character in 'path'. * * @param path The remote path of the file. */ public RemoteFile(String path) { resetData(); if (path == null || path.length() <= 0 || !path.startsWith(FileUtils.PATH_SEPARATOR)) { throw new IllegalArgumentException("Trying to create a OCFile with a non valid remote path: " + path); } mRemotePath = path; mCreationTimestamp = 0; mLength = 0; mMimeType = "DIR"; mQuotaUsedBytes = BigDecimal.ZERO; mQuotaAvailableBytes = BigDecimal.ZERO; mPrivateLink = null; }