diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 11:47:07 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 11:47:07 +0100 |
commit | 826020fe18bf2eee43f8afea392874bb88c0650a (patch) | |
tree | 7c6c40758611605be29b3528da647a78a071ea1b /java/com | |
parent | 3854bbdecd1c089959fb812a739b84a96c05fbbf (diff) | |
download | libguestfs-826020fe18bf2eee43f8afea392874bb88c0650a.tar.gz libguestfs-826020fe18bf2eee43f8afea392874bb88c0650a.tar.xz libguestfs-826020fe18bf2eee43f8afea392874bb88c0650a.zip |
Generated code for head/tail commands.
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/redhat/et/libguestfs/GuestFS.java | 108 |
1 files changed, 105 insertions, 3 deletions
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 64b0802b..30913327 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -3112,14 +3112,14 @@ public HashMap<String,String> test0rhashtableerr () * <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; /** @@ -3623,4 +3623,106 @@ public HashMap<String,String> test0rhashtableerr () 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; + } |