* <p>
* @throws LibGuestFSException
*/
- public void sfdisk_N (String device, int n, int cyls, int heads, int sectors, String line)
+ public void sfdisk_N (String device, int partnum, int cyls, int heads, int sectors, String line)
throws LibGuestFSException
{
if (g == 0)
throw new LibGuestFSException ("sfdisk_N: handle is closed");
- _sfdisk_N (g, device, n, cyls, heads, sectors, line);
+ _sfdisk_N (g, device, partnum, cyls, heads, sectors, line);
}
- private native void _sfdisk_N (long g, String device, int n, int cyls, int heads, int sectors, String line)
+ private native void _sfdisk_N (long g, String device, int partnum, int cyls, int heads, int sectors, String line)
throws LibGuestFSException;
/**
private native String _mkdtemp (long g, String template)
throws LibGuestFSException;
+ /**
+ * count lines in a file
+ * <p>
+ * This command counts the lines in a file, using the "wc
+ * -l" external command.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public int wc_l (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("wc_l: handle is closed");
+ return _wc_l (g, path);
+ }
+ private native int _wc_l (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * count words in a file
+ * <p>
+ * This command counts the words in a file, using the "wc
+ * -w" external command.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public int wc_w (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("wc_w: handle is closed");
+ return _wc_w (g, path);
+ }
+ private native int _wc_w (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * count characters in a file
+ * <p>
+ * This command counts the characters in a file, using the
+ * "wc -c" external command.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public int wc_c (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("wc_c: handle is closed");
+ return _wc_c (g, path);
+ }
+ private native int _wc_c (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * return first 10 lines of a file
+ * <p>
+ * This command returns up to the first 10 lines of a file
+ * as a list of strings.
+ * <p>
+ * Because of the message protocol, there is a transfer
+ * limit of somewhere between 2MB and 4MB. To transfer
+ * large files you should use FTP.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String[] head (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("head: handle is closed");
+ return _head (g, path);
+ }
+ private native String[] _head (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * return first N lines of a file
+ * <p>
+ * If the parameter "nrlines" is a positive number, this
+ * returns the first "nrlines" lines of the file "path".
+ * <p>
+ * If the parameter "nrlines" is a negative number, this
+ * returns lines from the file "path", excluding the last
+ * "nrlines" lines.
+ * <p>
+ * If the parameter "nrlines" is zero, this returns an
+ * empty list.
+ * <p>
+ * Because of the message protocol, there is a transfer
+ * limit of somewhere between 2MB and 4MB. To transfer
+ * large files you should use FTP.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String[] head_n (int nrlines, String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("head_n: handle is closed");
+ return _head_n (g, nrlines, path);
+ }
+ private native String[] _head_n (long g, int nrlines, String path)
+ throws LibGuestFSException;
+
+ /**
+ * return last 10 lines of a file
+ * <p>
+ * This command returns up to the last 10 lines of a file
+ * as a list of strings.
+ * <p>
+ * Because of the message protocol, there is a transfer
+ * limit of somewhere between 2MB and 4MB. To transfer
+ * large files you should use FTP.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String[] tail (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("tail: handle is closed");
+ return _tail (g, path);
+ }
+ private native String[] _tail (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * return last N lines of a file
+ * <p>
+ * If the parameter "nrlines" is a positive number, this
+ * returns the last "nrlines" lines of the file "path".
+ * <p>
+ * If the parameter "nrlines" is a negative number, this
+ * returns lines from the file "path", starting with the
+ * "-nrlines"th line.
+ * <p>
+ * If the parameter "nrlines" is zero, this returns an
+ * empty list.
+ * <p>
+ * Because of the message protocol, there is a transfer
+ * limit of somewhere between 2MB and 4MB. To transfer
+ * large files you should use FTP.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String[] tail_n (int nrlines, String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("tail_n: handle is closed");
+ return _tail_n (g, nrlines, path);
+ }
+ private native String[] _tail_n (long g, int nrlines, String path)
+ throws LibGuestFSException;
+
+ /**
+ * report file system disk space usage
+ * <p>
+ * This command runs the "df" command to report disk space
+ * used.
+ * <p>
+ * This command is mostly useful for interactive sessions.
+ * It is *not* intended that you try to parse the output
+ * string. Use "statvfs" from programs.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String df ()
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("df: handle is closed");
+ return _df (g);
+ }
+ private native String _df (long g)
+ throws LibGuestFSException;
+
+ /**
+ * report file system disk space usage (human readable)
+ * <p>
+ * This command runs the "df -h" command to report disk
+ * space used in human-readable format.
+ * <p>
+ * This command is mostly useful for interactive sessions.
+ * It is *not* intended that you try to parse the output
+ * string. Use "statvfs" from programs.
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String df_h ()
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("df_h: handle is closed");
+ return _df_h (g);
+ }
+ private native String _df_h (long g)
+ throws LibGuestFSException;
+
+ /**
+ * estimate file space usage
+ * <p>
+ * This command runs the "du -s" command to estimate file
+ * space usage for "path".
+ * <p>
+ * "path" can be a file or a directory. If "path" is a
+ * directory then the estimate includes the contents of the
+ * directory and all subdirectories (recursively).
+ * <p>
+ * The result is the estimated size in *kilobytes* (ie.
+ * units of 1024 bytes).
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public long du (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("du: handle is closed");
+ return _du (g, path);
+ }
+ private native long _du (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * list files in an initrd
+ * <p>
+ * This command lists out files contained in an initrd.
+ * <p>
+ * The files are listed without any initial "/" character.
+ * The files are listed in the order they appear (not
+ * necessarily alphabetical). Directory names are listed as
+ * separate items.
+ * <p>
+ * Old Linux kernels (2.4 and earlier) used a compressed
+ * ext2 filesystem as initrd. We *only* support the newer
+ * initramfs format (compressed cpio files).
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public String[] initrd_list (String path)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("initrd_list: handle is closed");
+ return _initrd_list (g, path);
+ }
+ private native String[] _initrd_list (long g, String path)
+ throws LibGuestFSException;
+
+ /**
+ * mount a file using the loop device
+ * <p>
+ * This command lets you mount "file" (a filesystem image
+ * in a file) on a mount point. It is entirely equivalent
+ * to the command "mount -o loop file mountpoint".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mount_loop (String file, String mountpoint)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mount_loop: handle is closed");
+ _mount_loop (g, file, mountpoint);
+ }
+ private native void _mount_loop (long g, String file, String mountpoint)
+ throws LibGuestFSException;
+
+ /**
+ * create a swap partition
+ * <p>
+ * Create a swap partition on "device".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mkswap (String device)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mkswap: handle is closed");
+ _mkswap (g, device);
+ }
+ private native void _mkswap (long g, String device)
+ throws LibGuestFSException;
+
+ /**
+ * create a swap partition with a label
+ * <p>
+ * Create a swap partition on "device" with label "label".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mkswap_L (String label, String device)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mkswap_L: handle is closed");
+ _mkswap_L (g, label, device);
+ }
+ private native void _mkswap_L (long g, String label, String device)
+ throws LibGuestFSException;
+
+ /**
+ * create a swap partition with an explicit UUID
+ * <p>
+ * Create a swap partition on "device" with UUID "uuid".
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void mkswap_U (String uuid, String device)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("mkswap_U: handle is closed");
+ _mkswap_U (g, uuid, device);
+ }
+ private native void _mkswap_U (long g, String uuid, String device)
+ throws LibGuestFSException;
+
}