本文整理汇总了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);
}
}
示例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());
}
}
}
}
示例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());
}
}
}
}
示例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());
}
}
}
示例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();
}