Package net.n2oapp.framework.config.util
Class FileSystemUtil
- java.lang.Object
-
- net.n2oapp.framework.config.util.FileSystemUtil
-
public class FileSystemUtil extends Object
- Since:
- 15.04.2015
- Author:
- operehod
-
-
Field Summary
Fields Modifier and Type Field Description static Predicate<String>FILE_NAME_WITHOUT_DOTS
-
Constructor Summary
Constructors Constructor Description FileSystemUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetContent(Node node)static InputStreamgetContentAsStream(String path)static InputStreamgetContentAsStream(String path, boolean isExistRequired)static StringgetContentByUri(String URI)static StringgetContentByUri(String URI, boolean isExistRequired)static StringgetContentFromResource(org.springframework.core.io.Resource resource)static longgetFileSizeByUri(String uri)static NodegetNodeByClasspathUri(String uri)static List<Node>getNodesByLocationPattern(String locationPattern)static List<Node>getNodesByLocationPattern(String locationPattern, Predicate<String> nameFilter)static voidremoveAllFromDirectory(String dir, List<String> excludePaths)static BooleanremoveContentByUri(String uri)static voidsaveContentToFile(InputStream content, File file)static voidsaveContentToFile(String content, File file)
-
-
-
Method Detail
-
saveContentToFile
public static void saveContentToFile(InputStream content, File file)
-
getNodesByLocationPattern
public static List<Node> getNodesByLocationPattern(String locationPattern)
-
getNodesByLocationPattern
public static List<Node> getNodesByLocationPattern(String locationPattern, Predicate<String> nameFilter)
-
getContentAsStream
public static InputStream getContentAsStream(String path) throws IOException
- Throws:
IOException
-
getContentAsStream
public static InputStream getContentAsStream(String path, boolean isExistRequired) throws IOException
- Throws:
IOException
-
getContentFromResource
public static String getContentFromResource(org.springframework.core.io.Resource resource)
-
removeAllFromDirectory
public static void removeAllFromDirectory(String dir, List<String> excludePaths) throws IOException
- Throws:
IOException
-
getFileSizeByUri
public static long getFileSizeByUri(String uri) throws IOException
- Throws:
IOException
-
-