/** * Share this dataset. */ public void share() { if (LIBZFS.zfs_share(handle) != 0) { throw new ZFSException(library); } }
/** * Share this dataset. */ public void share() { if (LIBZFS.zfs_share(handle) != 0) { throw new ZFSException(library); } }
/** * Share this dataset. */ public void shareISCSI() { if (LIBZFS.zfs_share_iscsi(handle) != 0) { throw new ZFSException(library); } }
/** * Unshare this dataset. */ public void unshareISCSI() { if (LIBZFS.zfs_unshare_iscsi(handle) != 0) { throw new ZFSException(library); } }
/** * Unshare this dataset. */ public void unshare() { if (LIBZFS.zfs_unshare(handle) != 0) { throw new ZFSException(library); } } }
ZFSObject(final LibZFS library, final zfs_handle_t handle) { this.library = library; if (handle == null) { throw new ZFSException(library); } this.handle = handle; this.name = LIBZFS.zfs_get_name(this.handle); }
ZFSObject(final LibZFS library, final zfs_handle_t handle) { this.library = library; if (handle == null) { throw new ZFSException(library); } this.handle = handle; this.name = LIBZFS.zfs_get_name(this.handle); }
/** * Unshare this dataset. */ public void unshare() { if (LIBZFS.zfs_unshare(handle) != 0) { throw new ZFSException(library); } } }
/** * Wipes out the dataset and all its data. Very dangerous. * * <p> * If this dataset contains nested datasets, this method fails with * {@link ErrorCode#EZFS_EXISTS}. */ public void destory() { if (LIBZFS.zfs_destroy(handle) != 0) throw new ZFSException(library,"Failed to destroy "+getName()); }
/** * Unmounts this file system. * * @param flags * See {@link MountFlags}. */ public void unmount(int flags) { if (LIBZFS.zfs_unmount(handle, null, flags) != 0) { throw new ZFSException(library,"Failed to unmount "+getName()); } }
/** * Mounts this file system. * * @param flags * See {@link MountFlags}. */ public void mount(int flags) { int r = LIBZFS.zfs_mount(handle, null, flags); if (r != 0) throw new ZFSException(library,"Failed to mount "+getName()+": code="+r); }
/** * Mounts this file system. * * @param flags * See {@link MountFlags}. */ public void mount(int flags) { if (LIBZFS.zfs_mount(handle, null, flags) != 0) throw new ZFSException(library,"Failed to mount "+getName()); }
/** * Renames this data set to another name. * * @return * {@link ZFSObject} representing the new renamed dataset. */ public ZFSObject rename(String fullName, boolean recursive) { if (LIBZFS.zfs_rename(handle, fullName, recursive) != 0) throw new ZFSException(library); return library.open(fullName); }
/** * Renames this data set to another name. * * @return * {@link ZFSObject} representing the new renamed dataset. */ public ZFSObject rename(String fullName, boolean recursive) { if (LIBZFS.zfs_rename(handle, fullName, recursive) != 0) throw new ZFSException(library); return library.open(fullName); }
/** * Sets a user-defined property. */ public void setProperty(String key, String value) { if (LIBZFS.zfs_prop_set(handle, key, value) != 0) throw new ZFSException(library,"Failed to set property "+key+" on "+getName()); }
/** * Revokes the specified set of permissions to this dataset. */ public void unallow(ACLBuilder acl) { for (PermissionBuilder b : acl.builders) { if(LIBZFS.zfs_perm_remove(handle,b.toNativeFormat(this))!=0) throw new ZFSException(library); } }
/** * Unmounts this file system. * * @param flags * See {@link MountFlags}. */ public void unmount(int flags) { if (LIBZFS.zfs_unmount(handle, null, flags) != 0) { throw new ZFSException(library,"Failed to unmount "+getName()); } }
/** * Sets a user-defined property. */ public void setProperty(String key, String value) { if (LIBZFS.zfs_prop_set(handle, key, value) != 0) throw new ZFSException(library,"Failed to set property "+key+" on "+getName()); }
/** * Grants the specified set of permissions to this dataset. */ public void allow(ACLBuilder acl) { for (PermissionBuilder b : acl.builders) { if(LIBZFS.zfs_perm_set(handle,b.toNativeFormat(this))!=0) throw new ZFSException(library); } }
/** * Clears the given property on this dataset, causing it to be inherited from its parent. */ public void inheritProperty(String key) { if (LIBZFS.zfs_prop_inherit(handle, key) != 0) throw new ZFSException(library); // libzfs doesn't show us a new value until we reopen the handle, so do it now dispose(); handle = LIBZFS.zfs_open(library.getHandle(), name, zfs_type_t.DATASET); }