File Utils were supported in the earlier version .but not in 1.0
heres a code snippet for copying files that might help u
private void copyFile(File fromFile, String toFile) throws IOException {
FileInputStream from = null;
FileOutputStream to = null;
try {
from = new FileOutputStream(fromFile);
to = new FileOutputStream(toFile);
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = from.read(buffer)) != -1)
to.write(buffer, 0, bytesRead); // write
} finally {
if (from != null)
try {
from.close();
} catch (IOException e) {
;
}
if (to != null)
try {
to.close();
} catch (IOException e) {
;
}
}
}
On Wed, Oct 15, 2008 at 8:54 PM, Sundog <[EMAIL PROTECTED]> wrote:
>
> I am sorry if this is an oft-answered question, but I can't seem to
> find any references to it anywhere. In a piece of example code that
> demonstrates something or other, there is included the library
> "android.os.FileUtils", which Android doesn't seem to recognize. Is
> there a simple answer for this? Is this package deprecated and, if so,
> what is the supported method of copying one file to another?
>
> Thanks in advance.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---