當前位置: 首頁>>代碼示例>>Java>>正文


Java FileHandle.file方法代碼示例

本文整理匯總了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);
  }
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:19,代碼來源:ModInputStream.java

示例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;
}
 
開發者ID:whitecostume,項目名稱:libgdx_ui_editor,代碼行數:20,代碼來源:NewSceneDialog.java

示例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);
	}
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:19,代碼來源:ModInputStream.java

示例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();
}
 
開發者ID:whitecostume,項目名稱:libgdx_ui_editor,代碼行數:8,代碼來源:FileUtils.java


注:本文中的com.badlogic.gdx.files.FileHandle.file方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。