当前位置: 首页>>代码示例>>Java>>正文


Java VPKEntry.getPath方法代码示例

本文整理汇总了Java中info.ata4.vpk.VPKEntry.getPath方法的典型用法代码示例。如果您正苦于以下问题:Java VPKEntry.getPath方法的具体用法?Java VPKEntry.getPath怎么用?Java VPKEntry.getPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在info.ata4.vpk.VPKEntry的用法示例。


在下文中一共展示了VPKEntry.getPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeScriptFileToDisk

import info.ata4.vpk.VPKEntry; //导入方法依赖的package包/类
protected void writeScriptFileToDisk(VPKEntry entryToWrite, boolean overwriteExisting)
{
    File existsChecker = new File(Paths.get(installDir, entryToWrite.getPath()).toString());
    boolean fileExistsLocally = existsChecker.exists();
    if (fileExistsLocally && !overwriteExisting)
    {
        return;
    }
    File entryFile = new File(Paths.get(installDir, "/dota/").toFile(), entryToWrite.getPath());
    File entryDir = entryFile.getParentFile();
    if (entryDir != null && !entryDir.exists())
    {
        entryDir.mkdirs();
    }
    try (final FileChannel fc = FileUtils.openOutputStream(entryFile).getChannel())
    {
        fc.write(entryToWrite.getData());
    }
    catch (IOException ex)
    {
        JOptionPane.showMessageDialog(this, "Error: Unable to write script file to disk.\nDetails: " + ex.getMessage(), "Error writing script file", JOptionPane.ERROR_MESSAGE);
    }
}
 
开发者ID:pingzing,项目名称:dota2-sound-editor,代码行数:24,代码来源:EditorPanel.java

示例2: buildHeroPortraits

import info.ata4.vpk.VPKEntry; //导入方法依赖的package包/类
private void buildHeroPortraits(VPKArchive vpk)
{

    BufferedImage image = null;
    for (VPKEntry entry : vpk.getEntriesForDir("resource/flash3/images/heroes/"))
    {            
        if (entry.getType().equals("png") && !(entry.getPath().contains("selection")))
        {
            File imageFile = new File(entry.getPath());

            try (FileChannel fc = FileUtils.openOutputStream(imageFile).getChannel())
            {
                fc.write(entry.getData());                    
                image = ImageIO.read(imageFile);                    
                portraitMap.put(entry.getName(), image);
            }
            catch (IOException ex)
            {
                System.err.println("Can't write " + entry.getPath() + ": " + ex.getMessage());
            }
        }
    }
}
 
开发者ID:pingzing,项目名称:dota2-sound-editor,代码行数:24,代码来源:PortraitFinder.java

示例3: buildItemPortraits

import info.ata4.vpk.VPKEntry; //导入方法依赖的package包/类
private void buildItemPortraits(VPKArchive vpk)
{

    BufferedImage image = null;
    for (VPKEntry entry : vpk.getEntriesForDir("resource/flash3/images/items/"))
    {            
        if (entry.getType().equals("png"))     
        {
            File imageFile = new File(entry.getPath());

            try (FileChannel fc = FileUtils.openOutputStream(imageFile).getChannel())
            {
                fc.write(entry.getData());                    
                image = ImageIO.read(imageFile);
                String item = entry.getName();
                portraitMap.put(item, image);                    
            }
            catch (IOException ex)
            {
                System.err.println("Can't write " + entry.getPath() + ": " + ex.getMessage());
            }
        }
    }        
}
 
开发者ID:pingzing,项目名称:dota2-sound-editor,代码行数:25,代码来源:PortraitFinder.java

示例4: buildAnnouncerPortraits

import info.ata4.vpk.VPKEntry; //导入方法依赖的package包/类
private void buildAnnouncerPortraits(VPKArchive vpk)
{
    
    BufferedImage image = null;
    for(VPKEntry entry : vpk.getEntriesForDir("resource/flash3/images/econ/announcer/"))
    {
        if (entry.getName().contains("large"))
        {
            continue; //don't grab the huge images, we won't use them.
        }
        
        File imageFile = new File(entry.getPath());
        
        try (FileChannel fc = FileUtils.openOutputStream(imageFile).getChannel())
        {
            fc.write(entry.getData());
            image = ImageIO.read(imageFile);
            String announcer = entry.getName();
            portraitMap.put(announcer, image);
        }
        catch (IOException ex)
        {
            System.err.println("Can't write " + entry.getPath() + ": " + ex.getMessage());
        }
    }
}
 
开发者ID:pingzing,项目名称:dota2-sound-editor,代码行数:27,代码来源:PortraitFinder.java

示例5: Script

import info.ata4.vpk.VPKEntry; //导入方法依赖的package包/类
public Script(VPKEntry scriptFile, Category category)
{
    _rawFileName = scriptFile.getName() + "." +  scriptFile.getType();
    _internalScriptName = StringParsing.getScriptNameFromFileName(_rawFileName);
    friendlyScriptName.set(StringParsing.prettyFormatScriptName(_internalScriptName));
    _parentCategoryName = category.getCategoryName();
    _isCustom = false;
    _vpkPath = scriptFile.getPath();
}
 
开发者ID:pingzing,项目名称:sonic-scream,代码行数:10,代码来源:Script.java


注:本文中的info.ata4.vpk.VPKEntry.getPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。