public class FilePreviewer extends Object
| Constructor and Description |
|---|
FilePreviewer() |
| Modifier and Type | Method and Description |
|---|---|
protected static LinkPreview |
getImagePreview(String fileName,
String path2Image,
String httpUrl,
String mimeType,
String context) |
protected static String |
getMimeType(File file,
String filenameWithExtension) |
protected static LinkPreview |
getPdfPreview(String fileName,
String path2Pdf,
String httpUrl,
String mimeType,
String context) |
protected static LinkPreview |
getUnhandledTypePreview(String fileName,
String path2Pdf,
String httpUrl,
String mimeType,
String context) |
static String |
saveThumbnailOnFTPAndGetUrl(String urlThumbnail,
String context)
When a link preview needs to be saved, the method save the thumbnail on the storage no longer using the external url
|
static File |
storeAndGetFile(String urlThumbnail)
Check if a resource at a given url exists or not.
|
protected static LinkPreview getPdfPreview(String fileName, String path2Pdf, String httpUrl, String mimeType, String context) throws Exception
fileNameLabel - thename of the filepath2Pdf - the path of the pdf filehttpUrl - the http url where the file is reachable atcontext - the current infrastructure context (scope)Exceptionprotected static LinkPreview getImagePreview(String fileName, String path2Image, String httpUrl, String mimeType, String context)
fileNameLabel - thename of the filepath2Image - the path of the image filehttpUrl - the http url where the file is reachable atExceptionprotected static LinkPreview getUnhandledTypePreview(String fileName, String path2Pdf, String httpUrl, String mimeType, String context) throws Exception
fileNameLabel - thename of the filepath2Pdf - the path of the pdf filehttpUrl - the http url where the file is reachable atExceptionprotected static String getMimeType(File file, String filenameWithExtension) throws IOException
file - IOExceptionMagicParseExceptionMagicMatchNotFoundExceptionMagicExceptionpublic static File storeAndGetFile(String urlThumbnail)
urlThumbnail - public static String saveThumbnailOnFTPAndGetUrl(String urlThumbnail, String context)
urlThumbnail - Copyright © 2021. All rights reserved.