5 guestfs-java - How to use libguestfs from Java
9 import com.redhat.et.libguestfs.*;
11 GuestFS g = new GuestFS ();
12 g.add_drive_opts ("disk.img", null);
17 This manual page documents how to call libguestfs from the Java
18 programming language. This page just documents the differences from
19 the C API and gives some examples. If you are not familiar with using
20 libguestfs, you also need to read L<guestfs(3)>.
22 =head2 CLOSING THE HANDLE
24 The handle is closed when it is reaped by the garbage collector.
25 Because libguestfs handles include a lot of state, it is also
26 possible to close (and hence free) them explicitly by calling
31 Errors from libguestfs functions are mapped into the
32 C<LibGuestFSException> exception. This has a single parameter which
33 is the error message (a C<String>).
35 Calling any method on a closed handle raises the same exception.
37 =head1 EXAMPLE 1: CREATE A DISK IMAGE
41 =head1 EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE
48 L<guestfs-examples(3)>,
53 L<guestfs-recipes(1)>,
55 L<http://libguestfs.org/>,
56 L<http://caml.inria.fr/>.
60 Richard W.M. Jones (C<rjones at redhat dot com>)
64 Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>
66 The examples in this manual page may be freely copied, modified and
67 distributed without any restrictions.
69 This library is free software; you can redistribute it and/or
70 modify it under the terms of the GNU Lesser General Public
71 License as published by the Free Software Foundation; either
72 version 2 of the License, or (at your option) any later version.
74 This library is distributed in the hope that it will be useful,
75 but WITHOUT ANY WARRANTY; without even the implied warranty of
76 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
77 Lesser General Public License for more details.
79 You should have received a copy of the GNU Lesser General Public
80 License along with this library; if not, write to the Free Software
81 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA