-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to verify that a resource is provided that returns a filename.
This resolves BAOBAB-2730, #43.
- Loading branch information
1 parent
6613fc4
commit ba5ed7c
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/com/afrozaar/wordpress/wpapi/v2/util/FilenameWrapperByteArrayResource.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,22 @@ | ||
package com.afrozaar.wordpress.wpapi.v2.util; | ||
|
||
import org.springframework.core.io.ByteArrayResource; | ||
|
||
public class FilenameWrapperByteArrayResource extends ByteArrayResource { | ||
final String fileName; | ||
|
||
public FilenameWrapperByteArrayResource(byte[] byteArray, String fileName) { | ||
super(byteArray); | ||
this.fileName = fileName; | ||
} | ||
|
||
public FilenameWrapperByteArrayResource(byte[] byteArray, String description, String fileName) { | ||
super(byteArray, description); | ||
this.fileName = fileName; | ||
} | ||
|
||
@Override | ||
public String getFilename() { | ||
return fileName; | ||
} | ||
} |
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