CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 17:51:38 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=8e01f6f33d8cb4e0b36b0a7f922c367df9995a2009486b43d5ca7a55497efdeaa%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22NIV_66Gfq57SVoPRAANhBW0wAL_3vJRE%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d034e77a7fc537-BLR
Untitled - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- paste
- 
- 
- Untitled
- BROKEN-ARROW
- DEC 27TH, 2021
- 589
- NEVER
- 3.99 KB
- raw download report
- public class AllYamlFilesInFolder {
- private final String folderName;
- private final boolean shallGenerateFiles;
- public AllYamlFilesInFolder(String folderName, boolean shallGenerateFiles) {
- this.folderName = folderName;
- this.shallGenerateFiles = shallGenerateFiles;
- }
- public File[] reload() {
- Map<String, File> map = new HashMap<>();
- List<String> filenamesFromDir = null;
- try {
- filenamesFromDir = getFilenamesForDirnameFromCP(this.folderName);
- } catch (URISyntaxException | IOException e) {
- e.printStackTrace();
- }
- File[] files = getYamlFiles(this.folderName, "yml");
- if (shallGenerateFiles) {
- int conter = 0;
- for (File file : files) {
- map.put(file.getName().replace(".yml", ""), file);
- }
- if (filenamesFromDir != null && (!map.isEmpty() || files.length == 0)) {
- for (String file : filenamesFromDir) {
- if (map.get(getFileName(file)) == null) {
- CustomContainersMainClass.getInstance().saveResource(file, false);
- conter++;
- }
- if (conter + 1 > filenamesFromDir.size())
- map.clear();
- }
- }
- }
- return files;
- }
- public String getFolders() {
- return "Chests_and_HoppersSettings";
- }
- public List<String> getFolder() {
- List<String> filenamesFromDir = null;
- try {
- filenamesFromDir = getFilenamesForDirnameFromCP(this.folderName);
- } catch (URISyntaxException | IOException e) {
- e.printStackTrace();
- }
- assert filenamesFromDir != null;
- return new ArrayList<>(filenamesFromDir);
- }
- public File[] getYamlFiles(String directory, String extension) {
- if (extension.startsWith("."))
- extension = extension.substring(1);
- final File dataFolder = new File(CustomContainersMainClass.getInstance().getDataFolder(), directory);
- if (!dataFolder.exists())
- dataFolder.mkdirs();
- final String finalExtension = extension;
- return dataFolder.listFiles((FileFilter) file -> !file.isDirectory() && file.getName().endsWith("." + finalExtension));
- }
- public String getFileName(String path) {
- Valid.checkBoolean(path != null && !path.isEmpty(), "The given path must not be empty!");
- int pos;
- if (path.lastIndexOf("/") == -1)
- pos = path.lastIndexOf("\\");
- else
- pos = path.lastIndexOf("/");
- if (pos > 0)
- path = path.substring(pos + 1, path.length());
- pos = path.lastIndexOf(".");
- if (pos > 0)
- path = path.substring(0, pos);
- return path;
- }
- public static List<String> getFilenamesForDirnameFromCP(String directoryName) throws
- URISyntaxException, IOException {
- List<String> filenames = new ArrayList<>();
- URL url = CustomContainersMainClass.class.getClassLoader().getResource(directoryName);
- if (url != null) {
- if (url.getProtocol().equals("file")) {
- File file = Paths.get(url.toURI()).toFile();
- if (file != null) {
- File[] files = file.listFiles();
- if (files != null) {
- for (File filename : files) {
- filenames.add(filename.toString());
- }
- }
- }
- } else if (url.getProtocol().equals("jar")) {
- String dirname = directoryName + "/";
- String path = url.getPath();
- String jarPath = path.substring(5, path.indexOf("!"));
- try (JarFile jar = new JarFile(URLDecoder.decode(jarPath, StandardCharsets.UTF_8.name()))) {
- Enumeration<JarEntry> entries = jar.entries();
- while (entries.hasMoreElements()) {
- JarEntry entry = entries.nextElement();
- String name = entry.getName();
- //System.out.println("name " + name + "entry " + entry + jarPath);
- if (name.startsWith(dirname) && !dirname.equals(name)) {
- URL resource = CustomContainersMainClass.class.getClassLoader().getResource(name);
- if (resource != null) {
- filenames.add(name);
- } else
- Common.log("Missing files in plugins/" + CustomContainersMainClass.getInstance() + ".jar/" + directoryName + "/, contact the author of " + CustomContainersMainClass.getInstance().getName() + ".");
- }
- }
- }
- }
- }
- return filenames;
- }
- }
- RAW Paste Data
- create new paste / syntax languages / archive / faq / tools / night mode / api / scraping api / news / pro
- privacy statement / cookies policy / terms of serviceupdated / security disclosure / dmca / report abuse / contact
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Swapzone Glitch ✅ Working⭐⭐⭐ D
JavaScript | 1 sec ago | 0.24 KB
-
⭐⭐⭐Profit Method⭐⭐
Java | 2 sec ago | 0.10 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 6 sec ago | 0.24 KB
-
⭐✅ Swapzone Glitch ✅ Working⭐⭐⭐ D
JavaScript | 10 sec ago | 0.24 KB
-
✅ Make $2500 in 20 minutes⭐⭐⭐ 3
JavaScript | 11 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ✅ NEVER SEEN...
JavaScript | 15 sec ago | 0.24 KB
-
⭐⭐Exchange Exploit⭐⭐ 9
JavaScript | 19 sec ago | 0.24 KB
-
✅ Make $2500 in 20 minutes⭐⭐⭐ 2
JavaScript | 23 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand