OSDN Git Service

lejos_NXJ_win32_0_3_0alpha.zip
[nxt-jsp/lejos_nxj.git] / nxtOSEK / lejos_nxj / docs / apidocs / java / io / File.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.5.0_09) on Sun Jul 15 14:27:35 BST 2007 -->
6 <TITLE>
7 File (leJOS NXT API documentation)
8 </TITLE>
9
10 <META NAME="keywords" CONTENT="java.io.File class">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17     parent.document.title="File (leJOS NXT API documentation)";
18 }
19 </SCRIPT>
20 <NOSCRIPT>
21 </NOSCRIPT>
22
23 </HEAD>
24
25 <BODY BGCOLOR="white" onload="windowTitle();">
26
27
28 <!-- ========= START OF TOP NAVBAR ======= -->
29 <A NAME="navbar_top"><!-- --></A>
30 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32 <TR>
33 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34 <A NAME="navbar_top_firstrow"><!-- --></A>
35 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36   <TR ALIGN="center" VALIGN="top">
37   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44   </TR>
45 </TABLE>
46 </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48 </EM>
49 </TD>
50 </TR>
51
52 <TR>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 &nbsp;<A HREF="../../java/io/DataOutputStream.html" title="class in java.io"><B>PREV CLASS</B></A>&nbsp;
55 &nbsp;<A HREF="../../java/io/FileInputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57   <A HREF="../../index.html?java/io/File.html" target="_top"><B>FRAMES</B></A>  &nbsp;
58 &nbsp;<A HREF="File.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
59 &nbsp;<SCRIPT type="text/javascript">
60   <!--
61   if(window==top) {
62     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
63   }
64   //-->
65 </SCRIPT>
66 <NOSCRIPT>
67   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
68 </NOSCRIPT>
69
70
71 </FONT></TD>
72 </TR>
73 <TR>
74 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78 </TR>
79 </TABLE>
80 <A NAME="skip-navbar_top"></A>
81 <!-- ========= END OF TOP NAVBAR ========= -->
82
83 <HR>
84 <!-- ======== START OF CLASS DATA ======== -->
85 <H2>
86 <FONT SIZE="-1">
87 java.io</FONT>
88 <BR>
89 Class File</H2>
90 <PRE>
91 <A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
92   <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>java.io.File</B>
93 </PRE>
94 <HR>
95 <DL>
96 <DT><PRE>public class <B>File</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></DL>
97 </PRE>
98
99 <P>
100 <HR>
101
102 <P>
103 <!-- =========== FIELD SUMMARY =========== -->
104
105 <A NAME="field_summary"><!-- --></A>
106 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
107 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
108 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
109 <B>Field Summary</B></FONT></TH>
110 </TR>
111 <TR BGCOLOR="white" CLASS="TableRowColor">
112 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
113 <CODE>protected static&nbsp;short</CODE></FONT></TD>
114 <TD><CODE><B><A HREF="../../java/io/File.html#BYTES_PER_PAGE">BYTES_PER_PAGE</A></B></CODE>
115
116 <BR>
117 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicates the # of bytes per page in the Flash class.</TD>
118 </TR>
119 <TR BGCOLOR="white" CLASS="TableRowColor">
120 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
121 <CODE>static&nbsp;byte</CODE></FONT></TD>
122 <TD><CODE><B><A HREF="../../java/io/File.html#MAX_FILES">MAX_FILES</A></B></CODE>
123
124 <BR>
125 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of files the file system can store.</TD>
126 </TR>
127 <TR BGCOLOR="white" CLASS="TableRowColor">
128 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
129 <CODE>static&nbsp;byte</CODE></FONT></TD>
130 <TD><CODE><B><A HREF="../../java/io/File.html#totalFiles">totalFiles</A></B></CODE>
131
132 <BR>
133 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The total number of files in the file system.</TD>
134 </TR>
135 </TABLE>
136 &nbsp;
137 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
138
139 <A NAME="constructor_summary"><!-- --></A>
140 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
141 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
142 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
143 <B>Constructor Summary</B></FONT></TH>
144 </TR>
145 <TR BGCOLOR="white" CLASS="TableRowColor">
146 <TD><CODE><B><A HREF="../../java/io/File.html#File(java.lang.String)">File</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;name)</CODE>
147
148 <BR>
149 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new File object.</TD>
150 </TR>
151 </TABLE>
152 &nbsp;
153 <!-- ========== METHOD SUMMARY =========== -->
154
155 <A NAME="method_summary"><!-- --></A>
156 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
157 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
158 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
159 <B>Method Summary</B></FONT></TH>
160 </TR>
161 <TR BGCOLOR="white" CLASS="TableRowColor">
162 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
163 <CODE>&nbsp;boolean</CODE></FONT></TD>
164 <TD><CODE><B><A HREF="../../java/io/File.html#createNewFile()">createNewFile</A></B>()</CODE>
165
166 <BR>
167 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new file entry in the flash memory.</TD>
168 </TR>
169 <TR BGCOLOR="white" CLASS="TableRowColor">
170 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
171 <CODE>static&nbsp;void</CODE></FONT></TD>
172 <TD><CODE><B><A HREF="../../java/io/File.html#defrag()">defrag</A></B>()</CODE>
173
174 <BR>
175 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assumptions: the files[] array has no nulls, and is in increasing order by page_location
176   this scheme moves moves each file down to fill in the empty pages.</TD>
177 </TR>
178 <TR BGCOLOR="white" CLASS="TableRowColor">
179 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
180 <CODE>&nbsp;boolean</CODE></FONT></TD>
181 <TD><CODE><B><A HREF="../../java/io/File.html#delete()">delete</A></B>()</CODE>
182
183 <BR>
184 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deletes the file represented by this File object.</TD>
185 </TR>
186 <TR BGCOLOR="white" CLASS="TableRowColor">
187 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
188 <CODE>&nbsp;void</CODE></FONT></TD>
189 <TD><CODE><B><A HREF="../../java/io/File.html#exec()">exec</A></B>()</CODE>
190
191 <BR>
192 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If the file is a binary executable, begins running it.</TD>
193 </TR>
194 <TR BGCOLOR="white" CLASS="TableRowColor">
195 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
196 <CODE>&nbsp;boolean</CODE></FONT></TD>
197 <TD><CODE><B><A HREF="../../java/io/File.html#exists()">exists</A></B>()</CODE>
198
199 <BR>
200 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicates if the file exists in the flash memory.</TD>
201 </TR>
202 <TR BGCOLOR="white" CLASS="TableRowColor">
203 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
204 <CODE>static&nbsp;void</CODE></FONT></TD>
205 <TD><CODE><B><A HREF="../../java/io/File.html#format()">format</A></B>()</CODE>
206
207 <BR>
208 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Essentially formats the file system by writing TABLE_ID characters to 
209  the first page of flash memroy.</TD>
210 </TR>
211 <TR BGCOLOR="white" CLASS="TableRowColor">
212 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
213 <CODE>static&nbsp;int</CODE></FONT></TD>
214 <TD><CODE><B><A HREF="../../java/io/File.html#freeMemory()">freeMemory</A></B>()</CODE>
215
216 <BR>
217 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
218 </TR>
219 <TR BGCOLOR="white" CLASS="TableRowColor">
220 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
221 <CODE>&nbsp;int</CODE></FONT></TD>
222 <TD><CODE><B><A HREF="../../java/io/File.html#getIndex()">getIndex</A></B>()</CODE>
223
224 <BR>
225 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returns location of file in the files[] array</TD>
226 </TR>
227 <TR BGCOLOR="white" CLASS="TableRowColor">
228 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
229 <CODE>&nbsp;<A HREF="../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
230 <TD><CODE><B><A HREF="../../java/io/File.html#getName()">getName</A></B>()</CODE>
231
232 <BR>
233 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the name of the file.</TD>
234 </TR>
235 <TR BGCOLOR="white" CLASS="TableRowColor">
236 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
237 <CODE>&nbsp;int</CODE></FONT></TD>
238 <TD><CODE><B><A HREF="../../java/io/File.html#getPage()">getPage</A></B>()</CODE>
239
240 <BR>
241 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
242 </TR>
243 <TR BGCOLOR="white" CLASS="TableRowColor">
244 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
245 <CODE>&nbsp;int</CODE></FONT></TD>
246 <TD><CODE><B><A HREF="../../java/io/File.html#length()">length</A></B>()</CODE>
247
248 <BR>
249 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the length of the file denoted by this file name.</TD>
250 </TR>
251 <TR BGCOLOR="white" CLASS="TableRowColor">
252 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
253 <CODE>static&nbsp;<A HREF="../../java/io/File.html" title="class in java.io">File</A>[]</CODE></FONT></TD>
254 <TD><CODE><B><A HREF="../../java/io/File.html#listFiles()">listFiles</A></B>()</CODE>
255
256 <BR>
257 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a list of files in the flash file system.</TD>
258 </TR>
259 <TR BGCOLOR="white" CLASS="TableRowColor">
260 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
261 <CODE>&nbsp;void</CODE></FONT></TD>
262 <TD><CODE><B><A HREF="../../java/io/File.html#moveToTop()">moveToTop</A></B>()</CODE>
263
264 <BR>
265 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;move the file to become the last one in flash memory</TD>
266 </TR>
267 </TABLE>
268 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
269 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
270 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
271 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
272 </TR>
273 <TR BGCOLOR="white" CLASS="TableRowColor">
274 <TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A></CODE></TD>
275 </TR>
276 </TABLE>
277 &nbsp;
278 <P>
279
280 <!-- ============ FIELD DETAIL =========== -->
281
282 <A NAME="field_detail"><!-- --></A>
283 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
284 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
285 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
286 <B>Field Detail</B></FONT></TH>
287 </TR>
288 </TABLE>
289
290 <A NAME="MAX_FILES"><!-- --></A><H3>
291 MAX_FILES</H3>
292 <PRE>
293 public static final byte <B>MAX_FILES</B></PRE>
294 <DL>
295 <DD>Number of files the file system can store. 
296   Defines the size of the files array. If leJOS gets a garbage
297   collector we can get rid of this limitation.
298 <P>
299 <DL>
300 <DT><B>See Also:</B><DD><A HREF="../../constant-values.html#java.io.File.MAX_FILES">Constant Field Values</A></DL>
301 </DL>
302 <HR>
303
304 <A NAME="BYTES_PER_PAGE"><!-- --></A><H3>
305 BYTES_PER_PAGE</H3>
306 <PRE>
307 protected static short <B>BYTES_PER_PAGE</B></PRE>
308 <DL>
309 <DD>Indicates the # of bytes per page in the Flash class.
310  Lawrie Griffiths determines this. Might want to access this
311  directly from Flash in future from a package level constant in case
312  we want to alter this number.
313 <P>
314 <DL>
315 </DL>
316 </DL>
317 <HR>
318
319 <A NAME="totalFiles"><!-- --></A><H3>
320 totalFiles</H3>
321 <PRE>
322 public static byte <B>totalFiles</B></PRE>
323 <DL>
324 <DD>The total number of files in the file system. A negative value 
325  indicates this variable has not been initialized. Using byte, but
326  if we expand past the 30 limit (garbage collector) we can use short.
327 <P>
328 <DL>
329 </DL>
330 </DL>
331
332 <!-- ========= CONSTRUCTOR DETAIL ======== -->
333
334 <A NAME="constructor_detail"><!-- --></A>
335 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
336 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
337 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
338 <B>Constructor Detail</B></FONT></TH>
339 </TR>
340 </TABLE>
341
342 <A NAME="File(java.lang.String)"><!-- --></A><H3>
343 File</H3>
344 <PRE>
345 public <B>File</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;name)</PRE>
346 <DL>
347 <DD>Creates a new File object. If this file exists on disk it will
348  represent that file. If the file does not exist, you will need to
349  use createNewFile() before writing to the file.
350 <P>
351 <DL>
352 <DT><B>Parameters:</B><DD><CODE>name</CODE> - </DL>
353 </DL>
354
355 <!-- ============ METHOD DETAIL ========== -->
356
357 <A NAME="method_detail"><!-- --></A>
358 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
359 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
360 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
361 <B>Method Detail</B></FONT></TH>
362 </TR>
363 </TABLE>
364
365 <A NAME="delete()"><!-- --></A><H3>
366 delete</H3>
367 <PRE>
368 public boolean <B>delete</B>()</PRE>
369 <DL>
370 <DD>Deletes the file represented by this File object.
371 <P>
372 <DD><DL>
373
374 <DT><B>Returns:</B><DD>true if the file is successfully deleted; false otherwise</DL>
375 </DD>
376 </DL>
377 <HR>
378
379 <A NAME="exec()"><!-- --></A><H3>
380 exec</H3>
381 <PRE>
382 public void <B>exec</B>()</PRE>
383 <DL>
384 <DD>If the file is a binary executable, begins running it.
385 <P>
386 <DD><DL>
387 </DL>
388 </DD>
389 </DL>
390 <HR>
391
392 <A NAME="listFiles()"><!-- --></A><H3>
393 listFiles</H3>
394 <PRE>
395 public static <A HREF="../../java/io/File.html" title="class in java.io">File</A>[] <B>listFiles</B>()</PRE>
396 <DL>
397 <DD>Returns a list of files in the flash file system. Because there are no
398   directories, this is a static method in leJOS NXJ. The order of the files
399   in the array goes from oldest (0) to newest (highest index array).
400 <P>
401 <DD><DL>
402
403 <DT><B>Returns:</B><DD>An array of File objects representing files in the file system.
404   The array will be empty if the directory is empty.
405   
406  NOTE: In the Java SDK this method should return an array
407  of size equaling the number of files. However, because leJOS has no garbage
408  collector it returns the same array that is always 30 in length. The unused
409  file spots are null. Use File.totalFiles to determine number of files.</DL>
410 </DD>
411 </DL>
412 <HR>
413
414 <A NAME="getName()"><!-- --></A><H3>
415 getName</H3>
416 <PRE>
417 public <A HREF="../../java/lang/String.html" title="class in java.lang">String</A> <B>getName</B>()</PRE>
418 <DL>
419 <DD>Returns the name of the file.
420 <P>
421 <DD><DL>
422
423 <DT><B>Returns:</B><DD>The name of the file, including the file extension. e.g. "mapdata.txt"</DL>
424 </DD>
425 </DL>
426 <HR>
427
428 <A NAME="length()"><!-- --></A><H3>
429 length</H3>
430 <PRE>
431 public int <B>length</B>()</PRE>
432 <DL>
433 <DD>Returns the length of the file denoted by this file name.
434 <P>
435 <DD><DL>
436
437 <DT><B>Returns:</B><DD>The length, in bytes, of the file denoted by this file name, or 0 if the file does not exist.</DL>
438 </DD>
439 </DL>
440 <HR>
441
442 <A NAME="exists()"><!-- --></A><H3>
443 exists</H3>
444 <PRE>
445 public boolean <B>exists</B>()</PRE>
446 <DL>
447 <DD>Indicates if the file exists in the flash memory.
448 <P>
449 <DD><DL>
450
451 <DT><B>Returns:</B><DD>True indicates the file exists, false means it has not been created.</DL>
452 </DD>
453 </DL>
454 <HR>
455
456 <A NAME="format()"><!-- --></A><H3>
457 format</H3>
458 <PRE>
459 public static void <B>format</B>()</PRE>
460 <DL>
461 <DD>Essentially formats the file system by writing TABLE_ID characters to 
462  the first page of flash memroy. Also writes 0 as the number of files
463  in the file system, so it can be used to restart/erase all files.
464 <P>
465 <DD><DL>
466 </DL>
467 </DD>
468 </DL>
469 <HR>
470
471 <A NAME="createNewFile()"><!-- --></A><H3>
472 createNewFile</H3>
473 <PRE>
474 public boolean <B>createNewFile</B>()</PRE>
475 <DL>
476 <DD>Creates a new file entry in the flash memory.
477 <P>
478 <DD><DL>
479
480 <DT><B>Returns:</B><DD>True indicates file was created in flash. False means it already existed or the size is 0 or less.</DL>
481 </DD>
482 </DL>
483 <HR>
484
485 <A NAME="moveToTop()"><!-- --></A><H3>
486 moveToTop</H3>
487 <PRE>
488 public void <B>moveToTop</B>()</PRE>
489 <DL>
490 <DD>move the file to become the last one in flash memory
491 <P>
492 <DD><DL>
493 </DL>
494 </DD>
495 </DL>
496 <HR>
497
498 <A NAME="freeMemory()"><!-- --></A><H3>
499 freeMemory</H3>
500 <PRE>
501 public static int <B>freeMemory</B>()</PRE>
502 <DL>
503 <DD><DL>
504 </DL>
505 </DD>
506 </DL>
507 <HR>
508
509 <A NAME="getIndex()"><!-- --></A><H3>
510 getIndex</H3>
511 <PRE>
512 public int <B>getIndex</B>()</PRE>
513 <DL>
514 <DD>returns location of file in the files[] array
515 <P>
516 <DD><DL>
517
518 <DT><B>Returns:</B><DD>index of file in files[]</DL>
519 </DD>
520 </DL>
521 <HR>
522
523 <A NAME="defrag()"><!-- --></A><H3>
524 defrag</H3>
525 <PRE>
526 public static void <B>defrag</B>()</PRE>
527 <DL>
528 <DD>assumptions: the files[] array has no nulls, and is in increasing order by page_location
529   this scheme moves moves each file down to fill in the empty pages.
530 <P>
531 <DD><DL>
532 </DL>
533 </DD>
534 </DL>
535 <HR>
536
537 <A NAME="getPage()"><!-- --></A><H3>
538 getPage</H3>
539 <PRE>
540 public int <B>getPage</B>()</PRE>
541 <DL>
542 <DD><DL>
543 </DL>
544 </DD>
545 </DL>
546 <!-- ========= END OF CLASS DATA ========= -->
547 <HR>
548
549
550 <!-- ======= START OF BOTTOM NAVBAR ====== -->
551 <A NAME="navbar_bottom"><!-- --></A>
552 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
553 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
554 <TR>
555 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
556 <A NAME="navbar_bottom_firstrow"><!-- --></A>
557 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
558   <TR ALIGN="center" VALIGN="top">
559   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
560   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
561   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
562   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
563   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
564   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
565   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
566   </TR>
567 </TABLE>
568 </TD>
569 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
570 </EM>
571 </TD>
572 </TR>
573
574 <TR>
575 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
576 &nbsp;<A HREF="../../java/io/DataOutputStream.html" title="class in java.io"><B>PREV CLASS</B></A>&nbsp;
577 &nbsp;<A HREF="../../java/io/FileInputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
578 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
579   <A HREF="../../index.html?java/io/File.html" target="_top"><B>FRAMES</B></A>  &nbsp;
580 &nbsp;<A HREF="File.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
581 &nbsp;<SCRIPT type="text/javascript">
582   <!--
583   if(window==top) {
584     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
585   }
586   //-->
587 </SCRIPT>
588 <NOSCRIPT>
589   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
590 </NOSCRIPT>
591
592
593 </FONT></TD>
594 </TR>
595 <TR>
596 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
597   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
598 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
599 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
600 </TR>
601 </TABLE>
602 <A NAME="skip-navbar_bottom"></A>
603 <!-- ======== END OF BOTTOM NAVBAR ======= -->
604
605 <HR>
606
607 </BODY>
608 </HTML>