This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
71 deletions.
There are no files selected for viewing
Submodule dav4android
updated
from 466380 to aec2f9
30 changes: 30 additions & 0 deletions
30
src/com/owncloud/android/lib/common/http/methods/webdav/CopyMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.owncloud.android.lib.common.http.methods.webdav; | ||
|
||
import at.bitfire.dav4android.exception.UnauthorizedException; | ||
import okhttp3.HttpUrl; | ||
|
||
public class CopyMethod extends DavMethod { | ||
|
||
final String destinationUrl; | ||
final boolean forceOverride; | ||
|
||
public CopyMethod(HttpUrl httpUrl, String destinationUrl, boolean forceOverride) { | ||
super(httpUrl); | ||
this.destinationUrl = destinationUrl; | ||
this.forceOverride = forceOverride; | ||
} | ||
|
||
@Override | ||
public int execute() throws Exception { | ||
try { | ||
mDavResource.copy(destinationUrl, forceOverride); | ||
|
||
mRequest = mDavResource.getRequest(); | ||
mResponse = mDavResource.getResponse(); | ||
|
||
} catch (UnauthorizedException davException) { | ||
// Do nothing, we will use the 401 code to handle the situation | ||
} | ||
return super.getStatusCode(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters