Help us improve by taking our short survey: https://www.hdfgroup.org/website-survey/

| HDF5 Last Updated on 2026-07-28 The HDF5 Field Guide

Loading...
Searching...
No Matches
Java Link (H5L) Interface

## Detailed Description

See also
  Links (H5L), C-API
  HDF5 Links, User Guide

## Functions
static synchronized native void | H5Lcopy (long src_loc, String src_name, long dst_loc, String dst_name, long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Lcreate_external (String file_name, String obj_name, long link_loc_id, String link_name, long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Lcreate_hard (long cur_loc, String cur_name, long dst_loc, String dst_name, long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Lcreate_soft (String link_target, long link_loc_id, String link_name, long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Ldelete (long loc_id, String name, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Ldelete_by_idx (long loc_id, String group_name, int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native boolean | H5Lexists (long loc_id, String name, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native H5L_info_t | H5Lget_info (long loc_id, String name, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native H5L_info_t | H5Lget_info_by_idx (long loc_id, String group_name, int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native String | H5Lget_name_by_idx (long loc_id, String group_name, int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native int | H5Lget_value (long loc_id, String name, String[] link_value, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native int | H5Lget_value_by_idx (long loc_id, String group_name, int idx_type, int order, long n, String[] link_value, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native int | H5Lis_registered (int link_cls_id) throws HDF5LibraryException
static synchronized native int | H5Literate (long grp_id, int idx_type, int order, long idx, H5L_iterate_t op, H5L_iterate_opdata_t op_data) throws HDF5LibraryException
static synchronized native int | H5Literate_by_name (long grp_id, String group_name, int idx_type, int order, long idx, H5L_iterate_t op, H5L_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Lmove (long src_loc, String src_name, long dst_loc, String dst_name, long lcpl_id, long lapl_id) throws HDF5LibraryException, NullPointerException
static synchronized native void | H5Lunregister (int link_cls_id) throws HDF5LibraryException
static synchronized native int | H5Lvisit (long grp_id, int idx_type, int order, H5L_iterate_t op, H5L_iterate_opdata_t op_data) throws HDF5LibraryException
static synchronized native int | H5Lvisit_by_name (long loc_id, String group_name, int idx_type, int order, H5L_iterate_t op, H5L_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException

## Function Documentation

## ◆ H5Lcopy()

synchronized native void H5Lcopy | ( | long | src_loc,
|  | String | src_name,
|  | long | dst_loc,
|  | String | dst_name,
|  | long | lcpl_id,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lcopy copies a link from one location to another.

Parameters

  src_loc | IN: Location identifier of the source link
  src_name | IN: Name of the link to be copied
  dst_loc | IN: Location identifier specifying the destination of the copy
  dst_name | IN: Name to be assigned to the new copy
  lcpl_id | IN: Link creation property list identifier
  lapl_id | IN: Link access property list identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | name is null.

## ◆ H5Lcreate_external()

synchronized native void H5Lcreate_external | ( | String | file_name,
|  | String | obj_name,
|  | long | link_loc_id,
|  | String | link_name,
|  | long | lcpl_id,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lcreate_external creates a new soft link to an external object, which is an object in a different HDF5 file from the location of the link.

Parameters

  file_name | IN: Name of the target file containing the target object.
  obj_name | IN: Path within the target file to the target object.
  link_loc_id | IN: The file or group identifier for the new link.
  link_name | IN: The name of the new link.
  lcpl_id | IN: Link creation property list identifier
  lapl_id | IN: Link access property list identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | name is null.

## ◆ H5Lcreate_hard()

synchronized native void H5Lcreate_hard | ( | long | cur_loc,
|  | String | cur_name,
|  | long | dst_loc,
|  | String | dst_name,
|  | long | lcpl_id,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lcreate_hard creates a new hard link to a pre-existing object in an HDF5 file.

Parameters

  cur_loc | IN: The file or group identifier for the target object.
  cur_name | IN: Name of the target object, which must already exist.
  dst_loc | IN: The file or group identifier for the new link.
  dst_name | IN: The name of the new link.
  lcpl_id | IN: Link creation property list identifier
  lapl_id | IN: Link access property list identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | cur_name or dst_name is null.

## ◆ H5Lcreate_soft()

synchronized native void H5Lcreate_soft | ( | String | link_target,
|  | long | link_loc_id,
|  | String | link_name,
|  | long | lcpl_id,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lcreate_soft creates a new soft link to an object in an HDF5 file.

Parameters

  link_target | IN: Path to the target object, which is not required to exist.
  link_loc_id | IN: The file or group identifier for the new link.
  link_name | IN: The name of the new link.
  lcpl_id | IN: Link creation property list identifier
  lapl_id | IN: Link access property list identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | link_name is null.

## ◆ H5Ldelete()

synchronized native void H5Ldelete | ( | long | loc_id,
|  | String | name,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Ldelete removes the link specified from a group.

Parameters

  loc_id | IN: Identifier of the file or group containing the object.
  name | IN: Name of the link to delete.
  lapl_id | IN: Link access property list identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | name is null.

## ◆ H5Ldelete_by_idx()

synchronized native void H5Ldelete_by_idx | ( | long | loc_id,
|  | String | group_name,
|  | int | idx_type,
|  | int | order,
|  | long | n,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Ldelete_by_idx removes the nth link in a group according to the specified order and in the specified index.

Parameters

  loc_id | IN: File or group identifier specifying location of subject group
  group_name | IN: Name of subject group
  idx_type | IN: Index or field which determines the order
  order | IN: Order within field or index
  n | IN: Link for which to retrieve information
  lapl_id | IN: Link access property list identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | group_name is null.

## ◆ H5Lexists()

synchronized native boolean H5Lexists | ( | long | loc_id,
|  | String | name,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lexists checks if a link with a particular name exists in a group.

Parameters

  loc_id | IN: Identifier of the file or group to query.
  name | IN: The name of the link to check.
  lapl_id | IN: Link access property list identifier

Returns
  a boolean, true if the name exists, otherwise false.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | name is null.

## ◆ H5Lget_info()

synchronized native H5L_info_t H5Lget_info | ( | long | loc_id,
|  | String | name,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lget_info returns information about the specified link.

Parameters

  loc_id | IN: Identifier of the file or group.
  name | IN: Name of the link for which information is being sought.
  lapl_id | IN: Link access property list identifier

Returns
  a buffer(H5L_info_t) for the link information.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | name is null.

## ◆ H5Lget_info_by_idx()

synchronized native H5L_info_t H5Lget_info_by_idx | ( | long | loc_id,
|  | String | group_name,
|  | int | idx_type,
|  | int | order,
|  | long | n,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lget_info_by_idx opens a named datatype at the location specified by loc_id and return an identifier for the datatype.

Parameters

  loc_id | IN: File or group identifier specifying location of subject group
  group_name | IN: Name of subject group
  idx_type | IN: Type of index
  order | IN: Order within field or index
  n | IN: Link for which to retrieve information
  lapl_id | IN: Link access property list identifier

Returns
  a buffer(H5L_info_t) for the link information.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | group_name is null.

## ◆ H5Lget_name_by_idx()

synchronized native String H5Lget_name_by_idx | ( | long | loc_id,
|  | String | group_name,
|  | int | idx_type,
|  | int | order,
|  | long | n,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lget_name_by_idx retrieves name of the nth link in a group, according to the order within a specified field or index.

Parameters

  loc_id | IN: File or group identifier specifying location of subject group
  group_name | IN: Name of subject group
  idx_type | IN: Type of index
  order | IN: Order within field or index
  n | IN: Link for which to retrieve information
  lapl_id | IN: Link access property list identifier

Returns
  a String for the link name.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | group_name is null.

## ◆ H5Lget_value()

synchronized native int H5Lget_value | ( | long | loc_id,
|  | String | name,
|  | String[] | link_value,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lget_value returns the link value of a symbolic link. Note that this function is a combination of H5Lget_info(), H5Lget_val() and for external links, H5Lunpack_elink_val.

Parameters

  loc_id | IN: Identifier of the file or group containing the object.
  name | IN: Name of the symbolic link.
  link_value | OUT: Path of the symbolic link, or the file_name and path of an external file.
  lapl_id | IN: Link access property list identifier

Returns
  the link type

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | name is null.

## ◆ H5Lget_value_by_idx()

synchronized native int H5Lget_value_by_idx | ( | long | loc_id,
|  | String | group_name,
|  | int | idx_type,
|  | int | order,
|  | long | n,
|  | String[] | link_value,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lget_value_by_idx retrieves value of the nth link in a group, according to the order within an index. Note that this function is a combination of H5Lget_info(), H5Lget_val() and for external links, H5Lunpack_elink_val.

Parameters

  loc_id | IN: File or group identifier specifying location of subject group
  group_name | IN: Name of subject group
  idx_type | IN: Type of index
  order | IN: Order within field or index
  n | IN: Link for which to retrieve information
  link_value | OUT: Path of the symbolic link, or the file_name and path of an external file.
  lapl_id | IN: Link access property list identifier

Returns
  the link type

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | group_name is null.

## ◆ H5Lis_registered()

synchronized native int H5Lis_registered | ( | int | link_cls_id | ) | throws HDF5LibraryException
| static

H5Lis_registered tests whether a user-defined link class is currently registered, either by the HDF5 Library or by the user through the use of H5Lregister.

Parameters

  link_cls_id | IN: User-defined link class identifier

Returns
  Returns a positive value if the link class has been registered and zero if it is unregistered. Otherwise returns a negative value; this may mean that the identifier is not a valid user-defined class identifier.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Literate()

synchronized native int H5Literate | ( | long | grp_id,
|  | int | idx_type,
|  | int | order,
|  | long | idx,
|  | H5L_iterate_t | op,
|  | H5L_iterate_opdata_t | op_data ) throws HDF5LibraryException
| static

H5Literate iterates through links in a group.

Parameters

  grp_id | IN: Identifier specifying subject group
  idx_type | IN: Type of index
  order | IN: Order of iteration within index
  idx | IN: Iteration position at which to start
  op | IN: Callback function passing data regarding the link to the calling application
  op_data | IN: User-defined pointer to data required by the application for its processing of the link

Returns
  returns the return value of the first operator that returns a positive value, or zero if all members were processed with no operator returning non-zero.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Literate_by_name()

synchronized native int H5Literate_by_name | ( | long | grp_id,
|  | String | group_name,
|  | int | idx_type,
|  | int | order,
|  | long | idx,
|  | H5L_iterate_t | op,
|  | H5L_iterate_opdata_t | op_data,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Literate_by_name iterates through links in a group.

Parameters

  grp_id | IN: Identifier specifying subject group
  group_name | IN: Name of subject group
  idx_type | IN: Type of index
  order | IN: Order of iteration within index
  idx | IN: Iteration position at which to start
  op | IN: Callback function passing data regarding the link to the calling application
  op_data | IN: User-defined pointer to data required by the application for its processing of the link
  lapl_id | IN: Link access property list identifier

Returns
  returns the return value of the first operator that returns a positive value, or zero if all members were processed with no operator returning non-zero.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | group_name is null.

## ◆ H5Lmove()

synchronized native void H5Lmove | ( | long | src_loc,
|  | String | src_name,
|  | long | dst_loc,
|  | String | dst_name,
|  | long | lcpl_id,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lmove renames a link within an HDF5 file.

Parameters

  src_loc | IN: Original file or group identifier.
  src_name | IN: Original link name.
  dst_loc | IN: Destination file or group identifier.
  dst_name | IN: New link name.
  lcpl_id | IN: Link creation property list identifier to be associated with the new link.
  lapl_id | IN: Link access property list identifier to be associated with the new link.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | name is null.

## ◆ H5Lunregister()

synchronized native void H5Lunregister | ( | int | link_cls_id | ) | throws HDF5LibraryException
| static

H5Lunregister unregisters a class of user-defined links, preventing them from being traversed, queried, moved, etc.

Parameters

  link_cls_id | IN: User-defined link class identifier

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Lvisit()

synchronized native int H5Lvisit | ( | long | grp_id,
|  | int | idx_type,
|  | int | order,
|  | H5L_iterate_t | op,
|  | H5L_iterate_opdata_t | op_data ) throws HDF5LibraryException
| static

H5Lvisit recursively visits all links starting from a specified group.

Parameters

  grp_id | IN: Identifier specifying subject group
  idx_type | IN: Type of index
  order | IN: Order of iteration within index
  op | IN: Callback function passing data regarding the link to the calling application
  op_data | IN: User-defined pointer to data required by the application for its processing of the link

Returns
  returns the return value of the first operator that returns a positive value, or zero if all members were processed with no operator returning non-zero.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.

## ◆ H5Lvisit_by_name()

synchronized native int H5Lvisit_by_name | ( | long | loc_id,
|  | String | group_name,
|  | int | idx_type,
|  | int | order,
|  | H5L_iterate_t | op,
|  | H5L_iterate_opdata_t | op_data,
|  | long | lapl_id ) throws HDF5LibraryException, NullPointerException
| static

H5Lvisit_by_name recursively visits all links starting from a specified group.

Parameters

  loc_id | IN: Identifier specifying subject group
  group_name | IN: Name of subject group
  idx_type | IN: Type of index
  order | IN: Order of iteration within index
  op | IN: Callback function passing data regarding the link to the calling application
  op_data | IN: User-defined pointer to data required by the application for its processing of the link
  lapl_id | IN: link access property

Returns
  returns the return value of the first operator that returns a positive value, or zero if all members were processed with no operator returning non-zero.

Exceptions

  HDF5LibraryException | Error from the HDF5 Library.
  NullPointerException | group_name is null.