当前位置: 首页>>代码示例>>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;未经允许,请勿转载。