X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=java%2Fcom%2Fredhat%2Fet%2Flibguestfs%2FGuestFS.java;h=36689700854041e34ff4cb0a9de0faf5fda88759;hp=cdc0f0947ce2c3721ead7de127ebd8643413831b;hb=bcb3fc0c3336c05e9ecbbfb25c7c31b42bd3e32e;hpb=da7cf3670fe60301beeb175ff6c284b737d5b7f4 diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index cdc0f09..3668970 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -427,7 +427,7 @@ public HashMap test0rhashtableerr () * to modify the image). *

* This is equivalent to the qemu parameter "-drive - * file=filename". + * file=filename,cache=off". *

* Note that this call checks for the existence of * "filename". This stops you from specifying other types @@ -2801,6 +2801,8 @@ public HashMap test0rhashtableerr () * sufficient to remove any partition tables, filesystem * superblocks and so on. *

+ * See also: "g.scrub_device". + *

* @throws LibGuestFSException */ public void zero (String device) @@ -3461,4 +3463,75 @@ public HashMap test0rhashtableerr () private native String[] _glob_expand (long g, String pattern) throws LibGuestFSException; + /** + * scrub (securely wipe) a device + *

+ * This command writes patterns over "device" to make data + * retrieval more difficult. + *

+ * It is an interface to the scrub(1) program. See that + * manual page for more details. + *

+ * This command is dangerous. Without careful use you can + * easily destroy all your data. + *

+ * @throws LibGuestFSException + */ + public void scrub_device (String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("scrub_device: handle is closed"); + _scrub_device (g, device); + } + private native void _scrub_device (long g, String device) + throws LibGuestFSException; + + /** + * scrub (securely wipe) a file + *

+ * This command writes patterns over a file to make data + * retrieval more difficult. + *

+ * The file is *removed* after scrubbing. + *

+ * It is an interface to the scrub(1) program. See that + * manual page for more details. + *

+ * @throws LibGuestFSException + */ + public void scrub_file (String file) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("scrub_file: handle is closed"); + _scrub_file (g, file); + } + private native void _scrub_file (long g, String file) + throws LibGuestFSException; + + /** + * scrub (securely wipe) free space + *

+ * This command creates the directory "dir" and then fills + * it with files until the filesystem is full, and scrubs + * the files as for "g.scrub_file", and deletes them. The + * intention is to scrub any free space on the partition + * containing "dir". + *

+ * It is an interface to the scrub(1) program. See that + * manual page for more details. + *

+ * @throws LibGuestFSException + */ + public void scrub_freespace (String dir) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("scrub_freespace: handle is closed"); + _scrub_freespace (g, dir); + } + private native void _scrub_freespace (long g, String dir) + throws LibGuestFSException; + }