Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor/remove custom MultipartFileSender to use Spring Boot Range r…
…equests
- Loading branch information
1 parent
01e61ae
commit 867aec4
Showing
7 changed files
with
364 additions
and
1,056 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
49 changes: 49 additions & 0 deletions
49
dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/BitstreamResource.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,49 @@ | ||
/** | ||
* The contents of this file are subject to the license and copyright | ||
* detailed in the LICENSE and NOTICE files at the root of the source | ||
* tree and available online at | ||
* | ||
* http://www.dspace.org/license/ | ||
*/ | ||
package org.dspace.app.rest.utils; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.UUID; | ||
|
||
import org.springframework.core.io.AbstractResource; | ||
|
||
public class BitstreamResource extends AbstractResource { | ||
|
||
private InputStream inputStream; | ||
private String name; | ||
private UUID uuid; | ||
private long sizeBytes; | ||
|
||
public BitstreamResource(InputStream inputStream, String name, UUID uuid, long sizeBytes) { | ||
this.inputStream = inputStream; | ||
this.name = name; | ||
this.uuid = uuid; | ||
this.sizeBytes = sizeBytes; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "bitstream [" + uuid + "]"; | ||
} | ||
|
||
@Override | ||
public InputStream getInputStream() throws IOException { | ||
return inputStream; | ||
} | ||
|
||
@Override | ||
public String getFilename() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public long contentLength() throws IOException { | ||
return sizeBytes; | ||
} | ||
} |
Oops, something went wrong.