<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:46 CET 2013 -->
<title>FileHandle (libgdx API)
</title>
<meta name="date" content="2013-11-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FileHandle (libgdx API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.
</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/FileHandle.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../index-all.html">Index
</a></li>
<li><a href="../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class
</li>
<li><a href="../../../../com/badlogic/gdx/files/FileHandleStream.html" title="class in com.badlogic.gdx.files"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/files/FileHandle.html" target="_top">Frames
</a></li>
<li><a href="FileHandle.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li>Nested
|
</li>
<li><a href="#field_summary">Field
</a> |
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li><a href="#field_detail">Field
</a> |
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.badlogic.gdx.files
</div>
<h2 title="Class FileHandle" class="title">Class FileHandle
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.files.FileHandle
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:
</dt>
<dd><a href="../../../../com/badlogic/gdx/files/FileHandleStream.html" title="class in com.badlogic.gdx.files">FileHandleStream
</a></dd>
</dl>
<hr>
<br>
<pre>public class
<span class="strong">FileHandle
</span>
extends java.lang.Object
</pre>
<div class="block">Represents a file or directory on the filesystem, classpath, Android SD card, or Android assets directory. FileHandles are
created via a
<a href="../../../../com/badlogic/gdx/Files.html" title="interface in com.badlogic.gdx"><code>Files
</code></a> instance.
Because some of the file types are backed by composite files and may be compressed (for example, if they are in an Android .apk or are
found via the classpath), the methods for extracting a
<a href="../../../../com/badlogic/gdx/files/FileHandle.html#path()"><code>path()
</code></a> or
<a href="../../../../com/badlogic/gdx/files/FileHandle.html#file()"><code>file()
</code></a> may not be appropriate for all types.
Use the Reader or Stream methods here to hide these dependencies from your platform independent code.
</div>
<dl><dt><span class="strong">Author:
</span></dt>
<dd>mzechner, Nathan Sweet
</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Field and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected java.io.File
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#file">file
</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected
<a href="../../../../com/badlogic/gdx/Files.FileType.html" title="enum in com.badlogic.gdx">Files.FileType
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#type">type
</a></strong></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier
</th>
<th class="colLast" scope="col">Constructor and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#FileHandle()">FileHandle
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code> </code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#FileHandle(java.io.File)">FileHandle
</a></strong>(java.io.File
file)
</code>
<div class="block">Creates a new absolute FileHandle for the
<code>File
</code>.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#FileHandle(java.io.File, com.badlogic.gdx.Files.FileType)">FileHandle
</a></strong>(java.io.File
file,
<a href="../../../../com/badlogic/gdx/Files.FileType.html" title="enum in com.badlogic.gdx">Files.FileType
</a> type)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code> </code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#FileHandle(java.lang.String)">FileHandle
</a></strong>(java.lang.String
fileName)
</code>
<div class="block">Creates a new absolute FileHandle for the file name.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#FileHandle(java.lang.String, com.badlogic.gdx.Files.FileType)">FileHandle
</a></strong>(java.lang.String
fileName,
<a href="../../../../com/badlogic/gdx/Files.FileType.html" title="enum in com.badlogic.gdx">Files.FileType
</a> type)
</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Method and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#child(java.lang.String)">child
</a></strong>(java.lang.String
name)
</code>
<div class="block">Returns a handle to the child with the specified name.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#copyTo(com.badlogic.gdx.files.FileHandle)">copyTo
</a></strong>(
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> dest)
</code>
<div class="block">Copies this file or directory to the specified file or directory.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#delete()">delete
</a></strong>()
</code>
<div class="block">Deletes this file or empty directory and returns success.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#deleteDirectory()">deleteDirectory
</a></strong>()
</code>
<div class="block">Deletes this file or directory and all children, recursively.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#emptyDirectory()">emptyDirectory
</a></strong>()
</code>
<div class="block">Deletes all children of this directory, recursively.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#emptyDirectory(boolean)">emptyDirectory
</a></strong>(boolean
preserveTree)
</code>
<div class="block">Deletes all children of this directory, recursively.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#equals(java.lang.Object)">equals
</a></strong>(java.lang.Object
obj)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#exists()">exists
</a></strong>()
</code>
<div class="block">Returns true if the file exists.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#extension()">extension
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.io.File
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#file()">file
</a></strong>()
</code>
<div class="block">Returns a java.io.File that represents this file handle.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#hashCode()">hashCode
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#isDirectory()">isDirectory
</a></strong>()
</code>
<div class="block">Returns true if this file is a directory.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#lastModified()">lastModified
</a></strong>()
</code>
<div class="block">Returns the last modified time in milliseconds for this file.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#length()">length
</a></strong>()
</code>
<div class="block">Returns the length in bytes of this file, or 0 if this file is a directory, does not exist, or the size cannot otherwise be
determined.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a>[]
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#list()">list
</a></strong>()
</code>
<div class="block">Returns the paths to the children of this directory.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a>[]
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#list(java.lang.String)">list
</a></strong>(java.lang.String
suffix)
</code>
<div class="block">Returns the paths to the children of this directory with the specified suffix.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#mkdirs()">mkdirs
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#moveTo(com.badlogic.gdx.files.FileHandle)">moveTo
</a></strong>(
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> dest)
</code>
<div class="block">Moves this file to the specified file, overwriting the file if it already exists.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#name()">name
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#nameWithoutExtension()">nameWithoutExtension
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#parent()">parent
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#path()">path
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#pathWithoutExtension()">pathWithoutExtension
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.io.InputStream
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#read()">read
</a></strong>()
</code>
<div class="block">Returns a stream for reading this file as bytes.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.io.BufferedInputStream
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#read(int)">read
</a></strong>(int
bufferSize)
</code>
<div class="block">Returns a buffered stream for reading this file as bytes.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>byte[]
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#readBytes()">readBytes
</a></strong>()
</code>
<div class="block">Reads the entire file into a byte array.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#readBytes(byte[], int, int)">readBytes
</a></strong>(byte[]
bytes,
int
offset,
int
size)
</code>
<div class="block">Reads the entire file into the byte array.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.io.Reader
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#reader()">reader
</a></strong>()
</code>
<div class="block">Returns a reader for reading this file as characters.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.io.BufferedReader
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#reader(int)">reader
</a></strong>(int
bufferSize)
</code>
<div class="block">Returns a buffered reader for reading this file as characters.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.io.BufferedReader
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#reader(int, java.lang.String)">reader
</a></strong>(int
bufferSize,
java.lang.String
charset)
</code>
<div class="block">Returns a buffered reader for reading this file as characters.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.io.Reader
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#reader(java.lang.String)">reader
</a></strong>(java.lang.String
charset)
</code>
<div class="block">Returns a reader for reading this file as characters.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#readString()">readString
</a></strong>()
</code>
<div class="block">Reads the entire file into a string using the platform's default charset.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#readString(java.lang.String)">readString
</a></strong>(java.lang.String
charset)
</code>
<div class="block">Reads the entire file into a string using the specified charset.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#sibling(java.lang.String)">sibling
</a></strong>(java.lang.String
name)
</code>
<div class="block">Returns a handle to the sibling with the specified name.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#tempDirectory(java.lang.String)">tempDirectory
</a></strong>(java.lang.String
prefix)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#tempFile(java.lang.String)">tempFile
</a></strong>(java.lang.String
prefix)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#toString()">toString
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/Files.FileType.html" title="enum in com.badlogic.gdx">Files.FileType
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#type()">type
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.io.OutputStream
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#write(boolean)">write
</a></strong>(boolean
append)
</code>
<div class="block">Returns a stream for writing to this file.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#write(java.io.InputStream, boolean)">write
</a></strong>(java.io.InputStream
input,
boolean
append)
</code>
<div class="block">Reads the remaining bytes from the specified stream and writes them to this file.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#writeBytes(byte[], boolean)">writeBytes
</a></strong>(byte[]
bytes,
boolean
append)
</code>
<div class="block">Writes the specified bytes to the file.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#writeBytes(byte[], int, int, boolean)">writeBytes
</a></strong>(byte[]
bytes,
int
offset,
int
length,
boolean
append)
</code>
<div class="block">Writes the specified bytes to the file.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.io.Writer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#writer(boolean)">writer
</a></strong>(boolean
append)
</code>
<div class="block">Returns a writer for writing to this file using the default charset.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.io.Writer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#writer(boolean, java.lang.String)">writer
</a></strong>(boolean
append,
java.lang.String
charset)
</code>
<div class="block">Returns a writer for writing to this file.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#writeString(java.lang.String, boolean)">writeString
</a></strong>(java.lang.String
string,
boolean
append)
</code>
<div class="block">Writes the specified string to the file using the default charset.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/files/FileHandle.html#writeString(java.lang.String, boolean, java.lang.String)">writeString
</a></strong>(java.lang.String
string,
boolean
append,
java.lang.String
charset)
</code>
<div class="block">Writes the specified string to the file as UTF-8.
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class
java.lang.Object
</h3>
<code>clone, finalize, getClass, notify, notifyAll, wait, wait, wait
</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail
</h3>
<a name="file">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>file
</h4>
<pre>protected
java.io.File file
</pre>
</li>
</ul>
<a name="type">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>type
</h4>
<pre>protected
<a href="../../../../com/badlogic/gdx/Files.FileType.html" title="enum in com.badlogic.gdx">Files.FileType
</a> type
</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail
</h3>
<a name="FileHandle()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileHandle
</h4>
<pre>protected
FileHandle()
</pre>
</li>
</ul>
<a name="FileHandle(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileHandle
</h4>
<pre>public
FileHandle(java.lang.String
fileName)
</pre>
<div class="block">Creates a new absolute FileHandle for the file name. Use this for tools on the desktop that don't need any of the backends.
Do not use this constructor in case you write something cross-platform. Use the
<a href="../../../../com/badlogic/gdx/Files.html" title="interface in com.badlogic.gdx"><code>Files
</code></a> interface instead.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>fileName
</code> - the filename.
</dd></dl>
</li>
</ul>
<a name="FileHandle(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileHandle
</h4>
<pre>public
FileHandle(java.io.File
file)
</pre>
<div class="block">Creates a new absolute FileHandle for the
<code>File
</code>. Use this for tools on the desktop that don't need any of the
backends. Do not use this constructor in case you write something cross-platform. Use the
<a href="../../../../com/badlogic/gdx/Files.html" title="interface in com.badlogic.gdx"><code>Files
</code></a> interface instead.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>file
</code> - the file.
</dd></dl>
</li>
</ul>
<a name="FileHandle(java.lang.String, com.badlogic.gdx.Files.FileType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileHandle
</h4>
<pre>protected
FileHandle(java.lang.String
fileName,
<a href="../../../../com/badlogic/gdx/Files.FileType.html" title="enum in com.badlogic.gdx">Files.FileType
</a> type)
</pre>
</li>
</ul>
<a name="FileHandle(java.io.File, com.badlogic.gdx.Files.FileType)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>FileHandle
</h4>
<pre>protected
FileHandle(java.io.File
file,
<a href="../../../../com/badlogic/gdx/Files.FileType.html" title="enum in com.badlogic.gdx">Files.FileType
</a> type)
</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail
</h3>
<a name="path()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>path
</h4>
<pre>public
java.lang.String
path()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the path of the file as specified on construction, e.g. Gdx.files.internal("dir/file.png") -> dir/file.png. backward
slashes will be replaced by forward slashes.
</dd></dl>
</li>
</ul>
<a name="name()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>name
</h4>
<pre>public
java.lang.String
name()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the name of the file, without any parent paths.
</dd></dl>
</li>
</ul>
<a name="extension()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>extension
</h4>
<pre>public
java.lang.String
extension()
</pre>
</li>
</ul>
<a name="nameWithoutExtension()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nameWithoutExtension
</h4>
<pre>public
java.lang.String
nameWithoutExtension()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the name of the file, without parent paths or the extension.
</dd></dl>
</li>
</ul>
<a name="pathWithoutExtension()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pathWithoutExtension
</h4>
<pre>public
java.lang.String
pathWithoutExtension()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the path and filename without the extension, e.g. dir/dir2/file.png -> dir/dir2/file. backward slashes will be
returned as forward slashes.
</dd></dl>
</li>
</ul>
<a name="type()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>type
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/Files.FileType.html" title="enum in com.badlogic.gdx">Files.FileType
</a> type()
</pre>
</li>
</ul>
<a name="file()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>file
</h4>
<pre>public
java.io.File
file()
</pre>
<div class="block">Returns a java.io.File that represents this file handle. Note the returned file will only be usable for
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Absolute"><code>Files.FileType.Absolute
</code></a> and
<a href="../../../../com/badlogic/gdx/Files.FileType.html#External"><code>Files.FileType.External
</code></a> file handles.
</div>
</li>
</ul>
<a name="read()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read
</h4>
<pre>public
java.io.InputStream
read()
</pre>
<div class="block">Returns a stream for reading this file as bytes.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="read(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read
</h4>
<pre>public
java.io.BufferedInputStream
read(int
bufferSize)
</pre>
<div class="block">Returns a buffered stream for reading this file as bytes.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="reader()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reader
</h4>
<pre>public
java.io.Reader
reader()
</pre>
<div class="block">Returns a reader for reading this file as characters.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="reader(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reader
</h4>
<pre>public
java.io.Reader
reader(java.lang.String
charset)
</pre>
<div class="block">Returns a reader for reading this file as characters.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="reader(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reader
</h4>
<pre>public
java.io.BufferedReader
reader(int
bufferSize)
</pre>
<div class="block">Returns a buffered reader for reading this file as characters.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="reader(int, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reader
</h4>
<pre>public
java.io.BufferedReader
reader(int
bufferSize,
java.lang.String
charset)
</pre>
<div class="block">Returns a buffered reader for reading this file as characters.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="readString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readString
</h4>
<pre>public
java.lang.String
readString()
</pre>
<div class="block">Reads the entire file into a string using the platform's default charset.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="readString(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readString
</h4>
<pre>public
java.lang.String
readString(java.lang.String
charset)
</pre>
<div class="block">Reads the entire file into a string using the specified charset.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="readBytes()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readBytes
</h4>
<pre>public
byte[]
readBytes()
</pre>
<div class="block">Reads the entire file into a byte array.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the file handle represents a directory, doesn't exist, or could not be read.
</dd></dl>
</li>
</ul>
<a name="readBytes(byte[], int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readBytes
</h4>
<pre>public
int
readBytes(byte[]
bytes,
int
offset,
int
size)
</pre>
<div class="block">Reads the entire file into the byte array. The byte array must be big enough to hold the file's data.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>bytes
</code> - the array to load the file into
</dd><dd><code>offset
</code> - the offset to start writing bytes
</dd><dd><code>size
</code> - the number of bytes to read, see
<a href="../../../../com/badlogic/gdx/files/FileHandle.html#length()"><code>length()
</code></a></dd>
<dt><span class="strong">Returns:
</span></dt><dd>the number of read bytes
</dd></dl>
</li>
</ul>
<a name="write(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write
</h4>
<pre>public
java.io.OutputStream
write(boolean
append)
</pre>
<div class="block">Returns a stream for writing to this file. Parent directories will be created if necessary.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>append
</code> - If false, this file will be overwritten if it exists, otherwise it will be appended.
</dd>
<dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle represents a directory, if it is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file, or if it could not be written.
</dd></dl>
</li>
</ul>
<a name="write(java.io.InputStream, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write
</h4>
<pre>public
void
write(java.io.InputStream
input,
boolean
append)
</pre>
<div class="block">Reads the remaining bytes from the specified stream and writes them to this file. The stream is closed. Parent directories
will be created if necessary.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>append
</code> - If false, this file will be overwritten if it exists, otherwise it will be appended.
</dd>
<dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle represents a directory, if it is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file, or if it could not be written.
</dd></dl>
</li>
</ul>
<a name="writer(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writer
</h4>
<pre>public
java.io.Writer
writer(boolean
append)
</pre>
<div class="block">Returns a writer for writing to this file using the default charset. Parent directories will be created if necessary.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>append
</code> - If false, this file will be overwritten if it exists, otherwise it will be appended.
</dd>
<dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle represents a directory, if it is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file, or if it could not be written.
</dd></dl>
</li>
</ul>
<a name="writer(boolean, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writer
</h4>
<pre>public
java.io.Writer
writer(boolean
append,
java.lang.String
charset)
</pre>
<div class="block">Returns a writer for writing to this file. Parent directories will be created if necessary.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>append
</code> - If false, this file will be overwritten if it exists, otherwise it will be appended.
</dd><dd><code>charset
</code> - May be null to use the default charset.
</dd>
<dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle represents a directory, if it is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file, or if it could not be written.
</dd></dl>
</li>
</ul>
<a name="writeString(java.lang.String, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeString
</h4>
<pre>public
void
writeString(java.lang.String
string,
boolean
append)
</pre>
<div class="block">Writes the specified string to the file using the default charset. Parent directories will be created if necessary.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>append
</code> - If false, this file will be overwritten if it exists, otherwise it will be appended.
</dd>
<dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle represents a directory, if it is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file, or if it could not be written.
</dd></dl>
</li>
</ul>
<a name="writeString(java.lang.String, boolean, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeString
</h4>
<pre>public
void
writeString(java.lang.String
string,
boolean
append,
java.lang.String
charset)
</pre>
<div class="block">Writes the specified string to the file as UTF-8. Parent directories will be created if necessary.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>append
</code> - If false, this file will be overwritten if it exists, otherwise it will be appended.
</dd><dd><code>charset
</code> - May be null to use the default charset.
</dd>
<dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle represents a directory, if it is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file, or if it could not be written.
</dd></dl>
</li>
</ul>
<a name="writeBytes(byte[], boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeBytes
</h4>
<pre>public
void
writeBytes(byte[]
bytes,
boolean
append)
</pre>
<div class="block">Writes the specified bytes to the file. Parent directories will be created if necessary.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>append
</code> - If false, this file will be overwritten if it exists, otherwise it will be appended.
</dd>
<dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle represents a directory, if it is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file, or if it could not be written.
</dd></dl>
</li>
</ul>
<a name="writeBytes(byte[], int, int, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeBytes
</h4>
<pre>public
void
writeBytes(byte[]
bytes,
int
offset,
int
length,
boolean
append)
</pre>
<div class="block">Writes the specified bytes to the file. Parent directories will be created if necessary.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>append
</code> - If false, this file will be overwritten if it exists, otherwise it will be appended.
</dd>
<dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle represents a directory, if it is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file, or if it could not be written.
</dd></dl>
</li>
</ul>
<a name="list()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>list
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a>[]
list()
</pre>
<div class="block">Returns the paths to the children of this directory. Returns an empty list if this file handle represents a file and not a
directory. On the desktop, an
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> handle to a directory on the classpath will return a zero length
array.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file is an
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> file.
</dd></dl>
</li>
</ul>
<a name="list(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>list
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a>[]
list(java.lang.String
suffix)
</pre>
<div class="block">Returns the paths to the children of this directory with the specified suffix. Returns an empty list if this file handle
represents a file and not a directory. On the desktop, an
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> handle to a directory on the classpath
will return a zero length array.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file is an
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> file.
</dd></dl>
</li>
</ul>
<a name="isDirectory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDirectory
</h4>
<pre>public
boolean
isDirectory()
</pre>
<div class="block">Returns true if this file is a directory. Always returns false for classpath files. On Android, an
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a>
handle to an empty directory will return false. On the desktop, an
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> handle to a directory on the
classpath will return false.
</div>
</li>
</ul>
<a name="child(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>child
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> child(java.lang.String
name)
</pre>
<div class="block">Returns a handle to the child with the specified name.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> and the child
doesn't exist.
</dd></dl>
</li>
</ul>
<a name="sibling(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sibling
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> sibling(java.lang.String
name)
</pre>
<div class="block">Returns a handle to the sibling with the specified name.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> and the sibling
doesn't exist, or this file is the root.
</dd></dl>
</li>
</ul>
<a name="parent()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parent
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> parent()
</pre>
</li>
</ul>
<a name="mkdirs()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mkdirs
</h4>
<pre>public
void
mkdirs()
</pre>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file.
</dd></dl>
</li>
</ul>
<a name="exists()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exists
</h4>
<pre>public
boolean
exists()
</pre>
<div class="block">Returns true if the file exists. On Android, a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> handle to a directory
will always return false. Note that this can be very slow for internal files on Android!
</div>
</li>
</ul>
<a name="delete()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>delete
</h4>
<pre>public
boolean
delete()
</pre>
<div class="block">Deletes this file or empty directory and returns success. Will not delete a directory that has children.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file.
</dd></dl>
</li>
</ul>
<a name="deleteDirectory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deleteDirectory
</h4>
<pre>public
boolean
deleteDirectory()
</pre>
<div class="block">Deletes this file or directory and all children, recursively.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file.
</dd></dl>
</li>
</ul>
<a name="emptyDirectory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>emptyDirectory
</h4>
<pre>public
void
emptyDirectory()
</pre>
<div class="block">Deletes all children of this directory, recursively.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file.
</dd></dl>
</li>
</ul>
<a name="emptyDirectory(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>emptyDirectory
</h4>
<pre>public
void
emptyDirectory(boolean
preserveTree)
</pre>
<div class="block">Deletes all children of this directory, recursively. Optionally preserving the folder structure.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if this file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file.
</dd></dl>
</li>
</ul>
<a name="copyTo(com.badlogic.gdx.files.FileHandle)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copyTo
</h4>
<pre>public
void
copyTo(
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> dest)
</pre>
<div class="block">Copies this file or directory to the specified file or directory. If this handle is a file, then 1) if the destination is a
file, it is overwritten, or 2) if the destination is a directory, this file is copied into it, or 3) if the destination
doesn't exist,
<a href="../../../../com/badlogic/gdx/files/FileHandle.html#mkdirs()"><code>mkdirs()
</code></a> is called on the destination's parent and this file is copied into it with a new name. If
this handle is a directory, then 1) if the destination is a file, GdxRuntimeException is thrown, or 2) if the destination is
a directory, this directory is copied into it recursively, overwriting existing files, or 3) if the destination doesn't
exist,
<a href="../../../../com/badlogic/gdx/files/FileHandle.html#mkdirs()"><code>mkdirs()
</code></a> is called on the destination and this directory is copied into it recursively.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the destination file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file,
or copying failed.
</dd></dl>
</li>
</ul>
<a name="moveTo(com.badlogic.gdx.files.FileHandle)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>moveTo
</h4>
<pre>public
void
moveTo(
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> dest)
</pre>
<div class="block">Moves this file to the specified file, overwriting the file if it already exists.
</div>
<dl><dt><span class="strong">Throws:
</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils">GdxRuntimeException
</a></code> - if the source or destination file handle is a
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> or
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> file.
</dd></dl>
</li>
</ul>
<a name="length()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>length
</h4>
<pre>public
long
length()
</pre>
<div class="block">Returns the length in bytes of this file, or 0 if this file is a directory, does not exist, or the size cannot otherwise be
determined.
</div>
</li>
</ul>
<a name="lastModified()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lastModified
</h4>
<pre>public
long
lastModified()
</pre>
<div class="block">Returns the last modified time in milliseconds for this file. Zero is returned if the file doesn't exist. Zero is returned
for
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Classpath"><code>Files.FileType.Classpath
</code></a> files. On Android, zero is returned for
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> files. On the desktop, zero
is returned for
<a href="../../../../com/badlogic/gdx/Files.FileType.html#Internal"><code>Files.FileType.Internal
</code></a> files on the classpath.
</div>
</li>
</ul>
<a name="equals(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals
</h4>
<pre>public
boolean
equals(java.lang.Object
obj)
</pre>
<dl>
<dt><strong>Overrides:
</strong></dt>
<dd><code>equals
</code> in class
<code>java.lang.Object
</code></dd>
</dl>
</li>
</ul>
<a name="hashCode()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode
</h4>
<pre>public
int
hashCode()
</pre>
<dl>
<dt><strong>Overrides:
</strong></dt>
<dd><code>hashCode
</code> in class
<code>java.lang.Object
</code></dd>
</dl>
</li>
</ul>
<a name="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString
</h4>
<pre>public
java.lang.String
toString()
</pre>
<dl>
<dt><strong>Overrides:
</strong></dt>
<dd><code>toString
</code> in class
<code>java.lang.Object
</code></dd>
</dl>
</li>
</ul>
<a name="tempFile(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>tempFile
</h4>
<pre>public static
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> tempFile(java.lang.String
prefix)
</pre>
</li>
</ul>
<a name="tempDirectory(java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>tempDirectory
</h4>
<pre>public static
<a href="../../../../com/badlogic/gdx/files/FileHandle.html" title="class in com.badlogic.gdx.files">FileHandle
</a> tempDirectory(java.lang.String
prefix)
</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/FileHandle.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../index-all.html">Index
</a></li>
<li><a href="../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>libgdx API
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class
</li>
<li><a href="../../../../com/badlogic/gdx/files/FileHandleStream.html" title="class in com.badlogic.gdx.files"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/files/FileHandle.html" target="_top">Frames
</a></li>
<li><a href="FileHandle.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li>Nested
|
</li>
<li><a href="#field_summary">Field
</a> |
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li><a href="#field_detail">Field
</a> |
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<div style="font-size:9pt"><i>
Copyright
© 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</small></p>
</body>
</html>