gpt4 book ai didi

org.jvnet.solaris.libzfs.ZFSException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 05:59:31 25 4
gpt4 key购买 nike

本文整理了Java中org.jvnet.solaris.libzfs.ZFSException.<init>()方法的一些代码示例,展示了ZFSException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZFSException.<init>()方法的具体详情如下:
包路径:org.jvnet.solaris.libzfs.ZFSException
类名称:ZFSException
方法名:<init>

ZFSException.<init>介绍

暂无

代码示例

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * Share this dataset.
 */
public void share() {
  if (LIBZFS.zfs_share(handle) != 0) {
    throw new ZFSException(library);
  }
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * Share this dataset.
 */
public void share() {
  if (LIBZFS.zfs_share(handle) != 0) {
    throw new ZFSException(library);
  }
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * Share this dataset.
 */
public void shareISCSI() {
  if (LIBZFS.zfs_share_iscsi(handle) != 0) {
    throw new ZFSException(library);
  }
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * Unshare this dataset.
 */
public void unshareISCSI() {
  if (LIBZFS.zfs_unshare_iscsi(handle) != 0) {
    throw new ZFSException(library);
  }
}

代码示例来源:origin: org.kohsuke/libzfs

/**
   * Unshare this dataset.
   */
  public void unshare() {
    if (LIBZFS.zfs_unshare(handle) != 0) {
      throw new ZFSException(library);
    }
  }
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

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);
}

代码示例来源:origin: org.kohsuke/libzfs

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);
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
   * Unshare this dataset.
   */
  public void unshare() {
    if (LIBZFS.zfs_unshare(handle) != 0) {
      throw new ZFSException(library);
    }
  }
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * 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());
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * 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());
  }
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * 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);
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * 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());
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * 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);
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * 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);
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * 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());
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * 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);
  }
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * 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());
  }
}

代码示例来源:origin: org.kohsuke/libzfs

/**
 * 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());
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * 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);
  }
}

代码示例来源:origin: org.jvnet.libzfs/libzfs

/**
 * 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);
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com