Class FileContent
- java.lang.Object
-
- com.technia.tif.enovia.integration.FileContent
-
@API public class FileContent extends java.lang.ObjectRepresents a file content: file name and input stream providing the content.- Since:
- 2021.2.0
-
-
Constructor Summary
Constructors Constructor Description FileContent(java.lang.String fileName, InputStreamProvider in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileContentfromFile(java.io.File file)Creates file content based on a File.static FileContentfromURL(java.net.URL url)Creates file content based on a URL.static FileContentfromURL(java.net.URL url, java.lang.String fileName)Creates file content based on a URL and file name.java.lang.StringgetFileName()java.io.InputStreamgetInputStream()
-
-
-
Constructor Detail
-
FileContent
public FileContent(java.lang.String fileName, InputStreamProvider in)
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Throws:
java.io.IOException
-
getFileName
public java.lang.String getFileName()
-
fromFile
public static FileContent fromFile(java.io.File file)
Creates file content based on a File.- Parameters:
file- File- Returns:
- FileContentProviderResult
-
fromURL
public static FileContent fromURL(java.net.URL url)
Creates file content based on a URL. NOTE: Detects the file name from URL path.- Parameters:
url- URL to file- Returns:
- FileContentProviderResult
-
fromURL
public static FileContent fromURL(java.net.URL url, java.lang.String fileName)
Creates file content based on a URL and file name.- Parameters:
url- URL to filefileName- The name of the file- Returns:
- FileContentProviderResult
-
-