如何在其他.jar文件中修改.yaml文件?

时间:2019-05-21 13:40:38

标签: java file jar

我正在设置.jar文件加载器,并且我想先修改.jar文件中的.yml文件,然后再以这种方式使用它。 Bukkit().getPluginManager().loadPlugin(File file);如果我正确理解,还必须保存更改。

我不知道该怎么做,因为我以前从未在Java 8中以这种方式使用过文件。如果有人,我会很高兴的

这里是我加载jar文件的方法,然后是我要修改并保存它的位置

for (final File file : folder.listFiles()) {// Get all files in the folder
        if (!file.isDirectory()) {// Only use the file, if it is a regular file
            try {
                if (FileManager.isJarFile(file)) {
                    // found a jar file
                    System.out.println("Found jarfile with possible yml.file in it: " + file.getName());

                    /*
                     * 
                     * Here it should modify the .jar file like above, bevore it gets loaded
                     * 
                     */

                }
            } catch (IOException e) {
                // Didn't found that jar file, can ignore it
            }
        }
    }

简短:那么该方法应该做什么?它应该加载jar文件,在其中加载.yml文件,修改文件,然后将更改再次保存在.jar文件中。

0 个答案:

没有答案
相关问题