本文整理汇总了Java中com.badlogic.gdx.files.FileHandle.file方法的典型用法代码示例。如果您正苦于以下问题:Java FileHandle.file方法的具体用法?Java FileHandle.file怎么用?Java FileHandle.file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.files.FileHandle
的用法示例。
在下文中一共展示了FileHandle.file方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ZipModInputStream
import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
public ZipModInputStream(FileHandle file) {
try {
inputStream = new FileInputStream(file.file());
zipInputStream = new ZipInputStream(inputStream);
fileStream = new FilterInputStream(zipInputStream) {
@Override
public void close() throws IOException {
// no close
}
};
} catch (Exception e) {
try {
close();
} catch (IOException ignored) {
}
throw new CubesException("Failed to create zip mod input stream", e);
}
}
示例2: createSceneFile
import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
private FileHandle createSceneFile(float width,float height,String name) throws IOException {
if (!path.isDirectory()){
path = path.parent();
}
StringBuilder filePath = new StringBuilder();
filePath.append(path.path());
filePath.append("/");
filePath.append(name);
filePath.append(".");
filePath.append(Config.sceneExtension);
FileHandle fileHandle = new FileHandle(filePath.toString());
if (fileHandle.file().exists()) fileHandle.delete();
fileHandle.file().createNewFile();
Writer writer = new FileWriter(fileHandle.file());
FileUtils.createScene(writer,width,height,name);
writer.close();
return fileHandle;
}
示例3: ZipModInputStream
import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
public ZipModInputStream(FileHandle file) {
try {
inputStream = new FileInputStream(file.file());
zipInputStream = new ZipInputStream(inputStream);
fileStream = new FilterInputStream(zipInputStream) {
@Override
public void close() throws IOException {
// no close
}
};
} catch (Exception e) {
try {
close();
} catch (IOException ignored) {
}
throw new CubesException("Failed to create zip mod input stream", e);
}
}
示例4: writeFile
import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
public static void writeFile(Group group, FileHandle fileHandle) throws IOException {
FileWriter writer = new FileWriter(fileHandle.file());
XmlWriter xmlWriter= new XmlWriter(writer);
writeAttr(xmlWriter,group);
xmlWriter.flush();
writer.close();
}