-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from rpmoore/deleteTape
Adding Delete tape API Call
- Loading branch information
Showing
5 changed files
with
71 additions
and
1 deletion.
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
28 changes: 28 additions & 0 deletions
28
ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteTapeRequest.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,28 @@ | ||
package com.spectralogic.ds3client.commands; | ||
|
||
import com.spectralogic.ds3client.HttpVerb; | ||
|
||
import java.util.UUID; | ||
|
||
public class DeleteTapeRequest extends AbstractRequest { | ||
|
||
private final UUID id; | ||
|
||
public DeleteTapeRequest(final UUID id) { | ||
this.id = id; | ||
} | ||
|
||
@Override | ||
public String getPath() { | ||
return "/_rest_/tape/" + id.toString(); | ||
} | ||
|
||
@Override | ||
public HttpVerb getVerb() { | ||
return HttpVerb.DELETE; | ||
} | ||
|
||
public UUID getId() { | ||
return id; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteTapeResponse.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,20 @@ | ||
package com.spectralogic.ds3client.commands; | ||
|
||
import com.spectralogic.ds3client.networking.WebResponse; | ||
|
||
import java.io.IOException; | ||
|
||
public class DeleteTapeResponse extends AbstractResponse { | ||
public DeleteTapeResponse(final WebResponse response) throws IOException { | ||
super(response); | ||
} | ||
|
||
@Override | ||
protected void processResponse() throws IOException { | ||
try { | ||
checkStatusCode(204); | ||
} finally { | ||
getResponse().close(); | ||
} | ||
} | ||
} |
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