Package io.micronaut.core.io
Class IOUtils
java.lang.Object
io.micronaut.core.io.IOUtils
Utility methods for I/O operations.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidIterates over each directory in a JAR or file system.static voidIterates over each directory in a JAR or file system.getResources(ClassLoader classLoader, String path) Find all the resources starting with the path.static StringreadText(BufferedReader reader) Read the content of the BufferedReader and return it as a String in a blocking manner.static @Nullable PathresolvePath(@NonNull URI uri, @NonNull String path, @NonNull List<Closeable> toClose) Resolve the path in the URI.
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
eachFile
Iterates over each directory in a JAR or file system.- Parameters:
url- The URLpath- The pathconsumer- The consumer- Since:
- 3.5.0
-
eachFile
Iterates over each directory in a JAR or file system.- Parameters:
uri- The URIpath- The pathconsumer- The consumer- Since:
- 3.5.0
-
resolvePath
public static @Nullable Path resolvePath(@NonNull URI uri, @NonNull String path, @NonNull List<Closeable> toClose) throws IOException Resolve the path in the URI.- Parameters:
uri- The URIpath- The pathtoClose- to close hooks- Returns:
- The path resolved
- Throws:
IOException- Since:
- 4.7
-
readText
Read the content of the BufferedReader and return it as a String in a blocking manner. The BufferedReader is closed afterward.- Parameters:
reader- a BufferedReader whose content we want to read- Returns:
- a String containing the content of the buffered reader
- Throws:
IOException- if an IOException occurs.- Since:
- 1.0
-
getResources
Find all the resources starting with the path.- Parameters:
classLoader- The classloaderpath- The path- Returns:
- the resources as URIs
- Throws:
IOException- The IO exception- Since:
- 4.7
-