• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IOUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.util.org.apache.commons.io.IOUtils的典型用法代码示例。如果您正苦于以下问题:Java IOUtils类的具体用法?Java IOUtils怎么用?Java IOUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IOUtils类属于net.minecraft.util.org.apache.commons.io包,在下文中一共展示了IOUtils类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: load

import net.minecraft.util.org.apache.commons.io.IOUtils; //导入依赖的package包/类
public void load() throws IOException { // CraftBukkit - Added throws
    Collection collection = null;
    BufferedReader bufferedreader = null;

    try {
        bufferedreader = Files.newReader(this.c, Charsets.UTF_8);
        collection = (Collection) this.b.fromJson(bufferedreader, f);
    } finally {
        IOUtils.closeQuietly(bufferedreader);
    }

    if (collection != null) {
        this.d.clear();
        Iterator iterator = collection.iterator();

        while (iterator.hasNext()) {
            JsonListEntry jsonlistentry = (JsonListEntry) iterator.next();

            if (jsonlistentry.getKey() != null) {
                this.d.put(this.a(jsonlistentry.getKey()), jsonlistentry);
            }
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:25,代码来源:JsonList.java


示例2: c

import net.minecraft.util.org.apache.commons.io.IOUtils; //导入依赖的package包/类
public void c() {
    String s = this.b.toJson(this.a(org.spigotmc.SpigotConfig.userCacheCap));
    BufferedWriter bufferedwriter = null;

    try {
        bufferedwriter = Files.newWriter(this.g, Charsets.UTF_8);
        bufferedwriter.write(s);
        return;
    } catch (FileNotFoundException filenotfoundexception) {
        return;
    } catch (IOException ioexception) {
        ;
    } finally {
        IOUtils.closeQuietly(bufferedwriter);
    }
}
 
开发者ID:pvginkel,项目名称:Tweakkit-Server,代码行数:17,代码来源:UserCache.java


示例3: loadLanguageStrings

import net.minecraft.util.org.apache.commons.io.IOUtils; //导入依赖的package包/类
private void loadLanguageStrings() {
    File languageFile = new File(plugin.getDataFolder(), "language.yml");
    InputStream resource = plugin.getResource("language.yml");

    if (!languageFile.exists()) {
        try {
            IOUtils.copy(resource, new FileOutputStream(languageFile));
        } catch (Exception e) {
            plugin.getLogger()
                    .warning("Default language file could not be written, unexpected results may appear!");
            e.printStackTrace();
        }
    }

    language = YamlConfiguration.loadConfiguration(languageFile);
    language.setDefaults(YamlConfiguration.loadConfiguration(resource));
}
 
开发者ID:ase34,项目名称:itemtrader,代码行数:18,代码来源:LanguageStrings.java


示例4: d

import net.minecraft.util.org.apache.commons.io.IOUtils; //导入依赖的package包/类
public String d() {
    StringWriter stringwriter = null;
    PrintWriter printwriter = null;
    Object object = this.c;

    if (((Throwable) object).getMessage() == null) {
        if (object instanceof NullPointerException) {
            object = new NullPointerException(this.b);
        } else if (object instanceof StackOverflowError) {
            object = new StackOverflowError(this.b);
        } else if (object instanceof OutOfMemoryError) {
            object = new OutOfMemoryError(this.b);
        }

        ((Throwable) object).setStackTrace(this.c.getStackTrace());
    }

    String s = ((Throwable) object).toString();

    try {
        stringwriter = new StringWriter();
        printwriter = new PrintWriter(stringwriter);
        ((Throwable) object).printStackTrace(printwriter);
        s = stringwriter.toString();
    } finally {
        IOUtils.closeQuietly(stringwriter);
        IOUtils.closeQuietly(printwriter);
    }

    return s;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:32,代码来源:CrashReport.java


示例5: save

import net.minecraft.util.org.apache.commons.io.IOUtils; //导入依赖的package包/类
public void save() throws IOException { // CraftBukkit - Added throws
    Collection collection = this.d.values();
    String s = this.b.toJson(collection);
    BufferedWriter bufferedwriter = null;

    try {
        bufferedwriter = Files.newWriter(this.c, Charsets.UTF_8);
        bufferedwriter.write(s);
    } finally {
        IOUtils.closeQuietly(bufferedwriter);
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:13,代码来源:JsonList.java


示例6: b

import net.minecraft.util.org.apache.commons.io.IOUtils; //导入依赖的package包/类
public void b() {
    List list = null;
    BufferedReader bufferedreader = null;

    label81: {
        try {
            bufferedreader = Files.newReader(this.g, Charsets.UTF_8);
            list = (List) this.b.fromJson(bufferedreader, h);
            break label81;
        } catch (FileNotFoundException filenotfoundexception) {
            ;
        // Spigot Start
        } catch (net.minecraft.util.com.google.gson.JsonSyntaxException ex) {
            JsonList.a.warn( "Usercache.json is corrupted or has bad formatting. Deleting it to prevent further issues." );
            this.g.delete();
        // Spigot End
        } finally {
            IOUtils.closeQuietly(bufferedreader);
        }

        return;
    }

    if (list != null) {
        this.c.clear();
        this.d.clear();
        LinkedList linkedlist = this.e;

        synchronized (this.e) {
            this.e.clear();
        }

        list = Lists.reverse(list);
        Iterator iterator = list.iterator();

        while (iterator.hasNext()) {
            UserCacheEntry usercacheentry = (UserCacheEntry) iterator.next();

            if (usercacheentry != null) {
                this.a(usercacheentry.a(), usercacheentry.b());
            }
        }
    }
}
 
开发者ID:pvginkel,项目名称:Tweakkit-Server,代码行数:45,代码来源:UserCache.java



注:本文中的net.minecraft.util.org.apache.commons.io.IOUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FormSubmitEvent类代码示例发布时间:2022-05-22
下一篇:
Java LibraryUtil类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap