Module wicket.bootstrap.extensions
Class SummernoteFileStorage
java.lang.Object
de.agilecoders.wicket.extensions.markup.html.bootstrap.editor.SummernoteFileStorage
- All Implemented Interfaces:
SummernoteStorage
A File storage for the summer note editor.
Example:
Example:
SummernoteStoredImageResourceReference:
mountResource(SummernoteStoredImageResourceReference.SUMMERNOTE_MOUNT_PATH, new SummernoteStoredImageResourceReference("storageId"));
Storage Initialization:
SummernoteConfig.addStorage(new SummernoteFileStorage("storageId", new File("/Users/Someone")));
Editor Config:
SummernoteConfig summernoteConfig = new SummernoteConfig();
summernoteConfig.useStorageId("storageId");
Result: Images are stored into
/User/Someone/storageId/<imageName>- Author:
- Tobias Soloschenko
-
Constructor Summary
ConstructorsConstructorDescriptionSummernoteFileStorage(String id, File folder) Creates a file storage which stores the images into the given folder and subfolder of the given id -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getContent(String imageName) Gets image data form the file systemgetId()Gets the id of the storagevoidwriteContent(String imageName, InputStream inputStream) Writes image data to the file system
-
Constructor Details
-
SummernoteFileStorage
Creates a file storage which stores the images into the given folder and subfolder of the given id- Parameters:
id- the id of the file storage which also is used as subfolder to store the imagesfolder- the folder to store images
-
-
Method Details
-
getContent
Gets image data form the file system- Specified by:
getContentin interfaceSummernoteStorage- Parameters:
imageName- the image name- Returns:
- the image bytes
-
writeContent
Writes image data to the file system- Specified by:
writeContentin interfaceSummernoteStorage- Parameters:
imageName- the name of the imageinputStream- the stream of the image
-
getId
Gets the id of the storage- Specified by:
getIdin interfaceSummernoteStorage- Returns:
- the id of the storage
-