Add Erlang bindings.
[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-erlang(3)>,
50 L<guestfs-ocaml(3)>,
51 L<guestfs-perl(3)>,
52 L<guestfs-python(3)>,
53 L<guestfs-recipes(1)>,
54 L<guestfs-ruby(3)>,
55 L<http://libguestfs.org/>,
56 L<http://caml.inria.fr/>.
57
58 =head1 AUTHORS
59
60 Richard W.M. Jones (C<rjones at redhat dot com>)
61
62 =head1 COPYRIGHT
63
64 Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>
65
66 The examples in this manual page may be freely copied, modified and
67 distributed without any restrictions.
68
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.
73
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.
78
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