
com.github.kospiotr.bundler.ResourceAccess Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bundler-maven-plugin Show documentation
Show all versions of bundler-maven-plugin Show documentation
Maven plugin for creating bundle package of js and css files in Maven project.
The newest version!
package com.github.kospiotr.bundler;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
class ResourceAccess {
public String read(Path path) {
try {
byte[] encoded = Files.readAllBytes(path);
return new String(encoded, StandardCharsets.UTF_8);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public void write(Path path, String s) {
try {
Files.createDirectories(path.getParent());
Files.write(path, s.getBytes());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy