diff options
author | Richard Jones <rjones@redhat.com> | 2009-06-08 17:44:18 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-06-08 17:44:18 +0100 |
commit | 460d139e6a52da67a4f1947035b1978610349f78 (patch) | |
tree | 798177aa71bc9615074cd1a9a351ff4b38165c7c /java | |
parent | 3de234656bc61a2d35b0f1a9ccb1e6ef7535166b (diff) | |
download | libguestfs-460d139e6a52da67a4f1947035b1978610349f78.tar.gz libguestfs-460d139e6a52da67a4f1947035b1978610349f78.tar.xz libguestfs-460d139e6a52da67a4f1947035b1978610349f78.zip |
Generated code for ntfs_3g_probe command.
Diffstat (limited to 'java')
-rw-r--r-- | java/com/redhat/et/libguestfs/GuestFS.java | 29 | ||||
-rw-r--r-- | java/com_redhat_et_libguestfs_GuestFS.c | 20 |
2 files changed, 49 insertions, 0 deletions
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 3f03d754..d29ae54f 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -3354,4 +3354,33 @@ public HashMap<String,String> test0rhashtableerr () private native void _sleep (long g, int secs) throws LibGuestFSException; + /** + * probe NTFS volume + * <p> + * This command runs the ntfs-3g.probe(8) command which + * probes an NTFS "device" for mountability. (Not all NTFS + * volumes can be mounted read-write, and some cannot be + * mounted at all). + * <p> + * "rw" is a boolean flag. Set it to true if you want to + * test if the volume can be mounted read-write. Set it to + * false if you want to test if the volume can be mounted + * read-only. + * <p> + * The return value is an integer which 0 if the operation + * would succeed, or some non-zero value documented in the + * ntfs-3g.probe(8) manual page. + * <p> + * @throws LibGuestFSException + */ + public int ntfs_3g_probe (boolean rw, String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("ntfs_3g_probe: handle is closed"); + return _ntfs_3g_probe (g, rw, device); + } + private native int _ntfs_3g_probe (long g, boolean rw, String device) + throws LibGuestFSException; + } diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c index fc207c12..91e3cf19 100644 --- a/java/com_redhat_et_libguestfs_GuestFS.c +++ b/java/com_redhat_et_libguestfs_GuestFS.c @@ -3966,3 +3966,23 @@ Java_com_redhat_et_libguestfs_GuestFS__1sleep } } +JNIEXPORT jint JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1ntfs_13g_1probe + (JNIEnv *env, jobject obj, jlong jg, jboolean jrw, jstring jdevice) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + int rw; + const char *device; + + rw = jrw; + device = (*env)->GetStringUTFChars (env, jdevice, NULL); + r = guestfs_ntfs_3g_probe (g, rw, device); + (*env)->ReleaseStringUTFChars (env, jdevice, device); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return 0; + } + return (jint) r; +} + |