Class TurFileUtils
java.lang.Object
com.viglet.turing.utils.TurFileUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic TurFileAttributesdocumentToText(org.springframework.web.multipart.MultipartFile multipartFile) static booleanisAllowedRemoteUrlString(String urlString) Helper method to validate a URL provided as a String before it is parsed and used.static booleanisSafe(InetAddress address) parseDocument(InputStream stream) static TurTikaFileAttributesstatic TurTikaFileAttributesparseFile(org.springframework.web.multipart.MultipartFile multipartFile) static TurTikaFileAttributesstatic TurTikaFileAttributesstatic TurFileAttributesurlContentToText(URL url)
-
Method Details
-
readFile
-
readFile
-
parseFile
-
parseFile
public static TurTikaFileAttributes parseFile(org.springframework.web.multipart.MultipartFile multipartFile) -
documentToText
public static TurFileAttributes documentToText(org.springframework.web.multipart.MultipartFile multipartFile) -
urlContentToText
-
isAllowedRemoteUrlString
Helper method to validate a URL provided as a String before it is parsed and used.- Parameters:
urlString- the URL string supplied by a client- Returns:
- true if the URL is syntactically valid and allowed according to isAllowedRemoteUrl(URL)
-
isSafe
-
parseDocument
- Throws:
IOException
-