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


Java FileHandle.delete方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.files.FileHandle.delete方法的典型用法代碼示例。如果您正苦於以下問題:Java FileHandle.delete方法的具體用法?Java FileHandle.delete怎麽用?Java FileHandle.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.files.FileHandle的用法示例。


在下文中一共展示了FileHandle.delete方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: action

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
@Override
public void action() {
    if (!visited) {
        text = "YOU WILL LOSE PROGRESS. OK?";
        visited = true;
    } else {
        resetVisited();
        soundtrackManager.stopSound();
        inputProcessor.activate();
        inputProcessor.saveConfiguration();
        FileHandle file = Gdx.files.local("state.sav");
        if (file.exists()) {
            file.delete();
        }
        ggvm.reset();
        menu = topLevelMenu;
    }
}
 
開發者ID:gradualgames,項目名稱:ggvm,代碼行數:19,代碼來源:PCMenu.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: read

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public static boolean read() {
	FileHandle fileHandle = Compatibility.get().getBaseFolder().child("settings.json");

	try {
		Reader reader = fileHandle.reader();
		JsonObject json = Json.parse(reader).asObject();
		reader.close();

		for (Member member : json) {
			Setting setting = set.settings.get(member.getName());
			setting.readJson(member.getValue());
		}

		return true;
	} catch (Exception e) {
		Log.error("Failed to read settings", e);
		fileHandle.delete();
		return false;
	}
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:21,代碼來源:Settings.java

示例4: write

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public static boolean write() {
	FileHandle fileHandle = Compatibility.get().getBaseFolder().child("settings.json");
	JsonObject json = new JsonObject();
	for (Map.Entry<String, Setting> entry : settings.entrySet()) {
		json.set(entry.getKey(), entry.getValue().toJson());
	}
	try {
		Writer writer = fileHandle.writer(false);
		json.writeTo(writer, WriterConfig.PRETTY_PRINT);
		writer.close();
	} catch (Exception e) {
		Log.error("Failed to write settings", e);
		fileHandle.delete();
		return false;
	}
	return true;
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:18,代碼來源:Settings.java

示例5: read

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public static boolean read() {
  FileHandle fileHandle = Compatibility.get().getBaseFolder().child("settings.json");
  
  try {
    Reader reader = fileHandle.reader();
    JsonObject json = Json.parse(reader).asObject();
    reader.close();

    for (Member member : json) {
      Setting setting = settings.get(member.getName());
      setting.readJson(member.getValue());
    }
    
    return true;
  } catch (Exception e) {
    Log.error("Failed to read settings", e);
    fileHandle.delete();
    return false;
  }
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:21,代碼來源:Settings.java

示例6: write

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public static boolean write() {
  FileHandle fileHandle = Compatibility.get().getBaseFolder().child("settings.json");
  JsonObject json = new JsonObject();
  for (Map.Entry<String, Setting> entry : settings.entrySet()) {
    json.set(entry.getKey(), entry.getValue().toJson());
  }
  try {
    Writer writer = fileHandle.writer(false);
    json.writeTo(writer, WriterConfig.PRETTY_PRINT);
    writer.close();
  } catch (Exception e) {
    Log.error("Failed to write settings", e);
    fileHandle.delete();
    return false;
  }
  return true;
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:18,代碼來源:Settings.java

示例7: dispose

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
@Override
public void dispose() {
    batch.dispose();
    originTexture.dispose();
    originTextureByDecryptor.dispose();
    decryptedTexture.dispose();
    FileHandle fileHandle = new FileHandle(encryptedFilePath);
    fileHandle.delete();
}
 
開發者ID:akivamu,項目名稱:libgdx-crypt-texture,代碼行數:10,代碼來源:SimpleGame.java

示例8: deleteSave

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
private void deleteSave() {
    final FileHandle handle = Gdx.files.local(SAVE_DAT_FILENAME);
    if (handle.exists())
        handle.delete();
}
 
開發者ID:LonamiWebs,項目名稱:Klooni1010,代碼行數:6,代碼來源:GameScreen.java

示例9: deleteFile

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public boolean deleteFile(String fileName) {
	final FileHandle fh = Gdx.files.external(basePath != null ? basePath + fileName : fileName);
	return fh.exists() && fh.delete();
}
 
開發者ID:kurtyu,項目名稱:PixelDungeonTC,代碼行數:5,代碼來源:Game.java


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