Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add delete, copy, move functionality to FedoraResourceImpl
- Add delete method to FedoraResourceImpl.java - Add specific exception to be thrown when creatng resource that exists - Add forceDelete() method to remove resource and tombstone - Implemented copy and move method in FedoraResourceImpl - Add an implementation of HttpCopy and HttpMove (missing from HTTP Client) - Add forceMove() to be coherent with other methods that manipulate tombstones Resolves: https://jira.duraspace.org/browse/FCREPO-1632
- Loading branch information
1 parent
0375aec
commit 6f485d8
Showing
10 changed files
with
535 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
63 changes: 63 additions & 0 deletions
63
fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpCopy.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,63 @@ | ||
/** | ||
* Copyright 2015 DuraSpace, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.fcrepo.client.utils; | ||
|
||
import java.net.URI; | ||
|
||
import org.apache.http.HttpHeaders; | ||
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; | ||
|
||
/** | ||
* HTTP copy | ||
* | ||
* @author sleroux | ||
* @since 2015-06-03 | ||
**/ | ||
public class HttpCopy extends HttpEntityEnclosingRequestBase { | ||
|
||
/** | ||
* Create an HTTP COPY request. | ||
* | ||
* @param source | ||
* Source URL. | ||
* @param destination | ||
* Destination URL. | ||
**/ | ||
public HttpCopy(final URI source, final URI destination) { | ||
this.setHeader(HttpHeaders.DESTINATION, destination.toASCIIString()); | ||
this.setURI(source); | ||
} | ||
|
||
/** | ||
* Create an HTTP COPY request. | ||
* | ||
* @param source | ||
* Source String URL. | ||
* @param destination | ||
* Destination String URL. | ||
**/ | ||
public HttpCopy(final String source, final String destination) { | ||
this(URI.create(source), URI.create(destination)); | ||
} | ||
|
||
/** | ||
* Returns the request method. | ||
**/ | ||
@Override | ||
public String getMethod() { | ||
return "COPY"; | ||
} | ||
} |
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
Oops, something went wrong.