java: Add guestfs-java(3) man page.
[libguestfs.git] / java / examples / guestfs-java.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 guestfs-java - How to use libguestfs from Java
6
7 =head1 SYNOPSIS
8
9  import com.redhat.et.libguestfs.*;
10  
11  GuestFS g = new GuestFS ();
12  g.add_drive_opts ("disk.img", null);
13  g.launch ();
14
15 =head1 DESCRIPTION
16
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)>.
21
22 =head2 CLOSING THE HANDLE
23
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
27 the C<close> method.
28
29 =head2 EXCEPTIONS
30
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>).
34
35 Calling any method on a closed handle raises the same exception.
36
37 =head1 EXAMPLE 1: CREATE A DISK IMAGE
38
39 @EXAMPLE1@
40
41 =head1 EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE
42
43 @EXAMPLE2@
44
45 =head1 SEE ALSO
46
47 L<guestfs(3)>,
48 L<guestfs-examples(3)>,
49 L<guestfs-ocaml(3)>,
50 L<guestfs-perl(3)>,
51 L<guestfs-python(3)>,
52 L<guestfs-recipes(1)>,
53 L<guestfs-ruby(3)>,
54 L<http://libguestfs.org/>,
55 L<http://caml.inria.fr/>.
56
57 =head1 AUTHORS
58
59 Richard W.M. Jones (C<rjones at redhat dot com>)
60
61 =head1 COPYRIGHT
62
63 Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>
64
65 The examples in this manual page may be freely copied, modified and
66 distributed without any restrictions.
67
68 This library is free software; you can redistribute it and/or
69 modify it under the terms of the GNU Lesser General Public
70 License as published by the Free Software Foundation; either
71 version 2 of the License, or (at your option) any later version.
72
73 This library is distributed in the hope that it will be useful,
74 but WITHOUT ANY WARRANTY; without even the implied warranty of
75 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
76 Lesser General Public License for more details.
77
78 You should have received a copy of the GNU Lesser General Public
79 License along with this library; if not, write to the Free Software
80 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA