diff options
Diffstat (limited to 'java/examples/groups')
-rw-r--r-- | java/examples/groups/CMakeLists.txt | 144 | ||||
-rw-r--r-- | java/examples/groups/H5Ex_G_Compact.java | 261 | ||||
-rw-r--r-- | java/examples/groups/H5Ex_G_Corder.java | 118 | ||||
-rw-r--r-- | java/examples/groups/H5Ex_G_Create.java | 88 | ||||
-rw-r--r-- | java/examples/groups/H5Ex_G_Intermediate.java | 126 | ||||
-rw-r--r-- | java/examples/groups/H5Ex_G_Iterate.java | 111 | ||||
-rw-r--r-- | java/examples/groups/H5Ex_G_Phase.java | 235 | ||||
-rw-r--r-- | java/examples/groups/H5Ex_G_Traverse.java | 167 | ||||
-rw-r--r-- | java/examples/groups/H5Ex_G_Visit.java | 154 | ||||
-rw-r--r-- | java/examples/groups/JavaGroupExample.sh.in | 381 | ||||
-rw-r--r-- | java/examples/groups/Makefile.am | 65 | ||||
-rw-r--r-- | java/examples/groups/h5ex_g_iterate.h5 | bin | 2928 -> 0 bytes | |||
-rw-r--r-- | java/examples/groups/h5ex_g_visit.h5 | bin | 6312 -> 0 bytes |
13 files changed, 0 insertions, 1850 deletions
diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt deleted file mode 100644 index fc9eb94..0000000 --- a/java/examples/groups/CMakeLists.txt +++ /dev/null @@ -1,144 +0,0 @@ -cmake_minimum_required (VERSION 3.18) -project (HDFJAVA_EXAMPLES_GROUPS Java) - -set (CMAKE_VERBOSE_MAKEFILE 1) - -set (HDF_JAVA_EXAMPLES - H5Ex_G_Create - H5Ex_G_Iterate - H5Ex_G_Compact - H5Ex_G_Corder - H5Ex_G_Intermediate - H5Ex_G_Phase - H5Ex_G_Visit -) - -if (WIN32) - set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else () - set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif () - -set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") - -set (CMAKE_JAVA_CLASSPATH ".") -foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) - set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach () - -foreach (example ${HDF_JAVA_EXAMPLES}) - file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt - "Main-Class: examples.groups.${example} -" - ) - add_jar (${example} MANIFEST ${PROJECT_BINARY_DIR}/${example}_Manifest.txt ${example}.java) - get_target_property (${example}_JAR_FILE ${example} JAR_FILE) -# install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) - get_target_property (${example}_CLASSPATH ${example} CLASSDIR) - add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) - - #----------------------------------------------------------------------------- - # Add Target to clang-format - #----------------------------------------------------------------------------- - if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_JAVA_${example}_SRC_FORMAT ${example}.java) - endif () -endforeach () - -set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") - -set (CMAKE_JAVA_CLASSPATH ".") -foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) - set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach () - -set (HDF_JAVA_TEST_FILES - h5ex_g_iterate.h5 - h5ex_g_visit.h5 -) - -foreach (h5_file ${HDF_JAVA_TEST_FILES}) - HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "H5Ex_G_Visit_files") -endforeach () -add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list}) - -if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) - get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>:${CMAKE_DEBUG_POSTFIX}>;") - - set (last_test "") - foreach (example ${HDF_JAVA_EXAMPLES}) - if (NOT example STREQUAL "H5Ex_G_Iterate" AND NOT example STREQUAL "H5Ex_G_Visit") - if (example STREQUAL "H5Ex_G_Compact") - add_test ( - NAME JAVA_groups-${example}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}1.h5 - ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}2.h5 - ) - else () - add_test ( - NAME JAVA_groups-${example}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 - ) - endif () - else () - add_test ( - NAME JAVA_groups-${example}-clear-objects - COMMAND ${CMAKE_COMMAND} -E echo "${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 exists" - ) - endif () - if (last_test) - set_tests_properties (JAVA_groups-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - - add_test ( - NAME JAVA_groups-${example}-copy-objects - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${HDFJAVA_EXAMPLES_SOURCE_DIR}/testfiles/examples.groups.${example}.txt - ${HDFJAVA_EXAMPLES_GROUPS_BINARY_DIR}/${example}.txt - ) - set_tests_properties (JAVA_groups-${example}-copy-objects PROPERTIES DEPENDS JAVA_groups-${example}-clear-objects) - add_test ( - NAME JAVA_groups-${example} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}" - -D "TEST_PROGRAM=examples.groups.${example}" - -D "TEST_ARGS:STRING=${CMD_ARGS}" - -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${example}_JAR_FILE}" - -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" - -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}" - -D "TEST_OUTPUT=groups/${example}.out" - -D "TEST_EXPECT=0" - -D "TEST_REFERENCE=groups/${example}.txt" - -P "${HDF_RESOURCES_DIR}/jrunTest.cmake" - ) - set_tests_properties (JAVA_groups-${example} PROPERTIES - DEPENDS JAVA_groups-${example}-copy-objects - ) - - if (NOT example STREQUAL "H5Ex_G_Iterate" AND NOT example STREQUAL "H5Ex_G_Visit") - if (example STREQUAL "H5Ex_G_Compact") - add_test ( - NAME JAVA_groups-${example}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove - ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}1.h5 - ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}2.h5 - ) - else () - add_test ( - NAME JAVA_groups-${example}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove - ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 - ) - endif () - set_tests_properties (JAVA_groups-${example}-clean-objects PROPERTIES - DEPENDS JAVA_groups-${example} - ) - set (last_test "JAVA_groups-${example}-clean-objects") - else () - set (last_test "JAVA_groups-${example}") - endif () - endforeach () -endif () diff --git a/java/examples/groups/H5Ex_G_Compact.java b/java/examples/groups/H5Ex_G_Compact.java deleted file mode 100644 index 2c6535a..0000000 --- a/java/examples/groups/H5Ex_G_Compact.java +++ /dev/null @@ -1,261 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - Creating a file and print the storage layout. - ************************************************************/ - -package examples.groups; - -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; -import hdf.hdf5lib.structs.H5G_info_t; - -public class H5Ex_G_Compact { - - private static final String FILE1 = "H5Ex_G_Compact1.h5"; - private static final String FILE2 = "H5Ex_G_Compact2.h5"; - private static final String GROUP = "G1"; - - enum H5G_storage { - H5G_STORAGE_TYPE_UNKNOWN(-1), - H5G_STORAGE_TYPE_SYMBOL_TABLE(0), - H5G_STORAGE_TYPE_COMPACT(1), - H5G_STORAGE_TYPE_DENSE(2); - - private static final Map<Integer, H5G_storage> lookup = new HashMap<Integer, H5G_storage>(); - - static - { - for (H5G_storage s : EnumSet.allOf(H5G_storage.class)) - lookup.put(s.getCode(), s); - } - - private int code; - - H5G_storage(int layout_type) { this.code = layout_type; } - - public int getCode() { return this.code; } - - public static H5G_storage get(int code) { return lookup.get(code); } - } - - public static void CreateGroup() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long group_id = HDF5Constants.H5I_INVALID_HID; - long fapl_id = HDF5Constants.H5I_INVALID_HID; - H5G_info_t ginfo; - long size; - - // Create file 1. This file will use original format groups. - try { - file_id = H5.H5Fcreate(FILE1, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - // Create a group in the file1. - try { - if (file_id >= 0) - group_id = H5.H5Gcreate(file_id, GROUP, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Obtain the group info and print the group storage type. - try { - if (group_id >= 0) { - ginfo = H5.H5Gget_info(group_id); - System.out.print("Group storage type for " + FILE1 + " is: "); - switch (H5G_storage.get(ginfo.storage_type)) { - case H5G_STORAGE_TYPE_COMPACT: - System.out.println("H5G_STORAGE_TYPE_COMPACT"); // New compact format - break; - case H5G_STORAGE_TYPE_DENSE: - System.out.println("H5G_STORAGE_TYPE_DENSE"); // New dense (indexed) format - break; - case H5G_STORAGE_TYPE_SYMBOL_TABLE: - System.out.println("H5G_STORAGE_TYPE_SYMBOL_TABLE"); // Original format - break; - case H5G_STORAGE_TYPE_UNKNOWN: - System.out.println("H5G_STORAGE_TYPE_UNKNOWN"); - break; - default: - System.out.println("Storage Type Invalid"); - break; - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group. - try { - if (group_id >= 0) - H5.H5Gclose(group_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // close the file 1. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Re-open file 1. Need to get the correct file size. - try { - file_id = H5.H5Fopen(FILE1, HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Obtain and print the file size. - try { - if (file_id >= 0) { - size = H5.H5Fget_filesize(file_id); - System.out.println("File size for " + FILE1 + " is: " + size + " bytes"); - } - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close FILE1. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Set file access property list to allow the latest file format. - // This will allow the library to create new compact format groups. - try { - fapl_id = H5.H5Pcreate(HDF5Constants.H5P_FILE_ACCESS); - if (fapl_id >= 0) - H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST, - HDF5Constants.H5F_LIBVER_LATEST); - } - catch (Exception e) { - e.printStackTrace(); - } - System.out.println(); - // Create file 2 using the new file access property list. - try { - file_id = H5.H5Fcreate(FILE2, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, fapl_id); - } - catch (Exception e) { - e.printStackTrace(); - } - // Create group in file2. - try { - if (file_id >= 0) - group_id = H5.H5Gcreate(file_id, GROUP, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Obtain the group info and print the group storage type. - try { - if (group_id >= 0) { - ginfo = H5.H5Gget_info(group_id); - System.out.print("Group storage type for " + FILE2 + " is: "); - switch (H5G_storage.get(ginfo.storage_type)) { - case H5G_STORAGE_TYPE_COMPACT: - System.out.println("H5G_STORAGE_TYPE_COMPACT"); // New compact format - break; - case H5G_STORAGE_TYPE_DENSE: - System.out.println("H5G_STORAGE_TYPE_DENSE"); // New dense (indexed) format - break; - case H5G_STORAGE_TYPE_SYMBOL_TABLE: - System.out.println("H5G_STORAGE_TYPE_SYMBOL_TABLE"); // Original format - break; - case H5G_STORAGE_TYPE_UNKNOWN: - System.out.println("H5G_STORAGE_TYPE_UNKNOWN"); - break; - default: - System.out.println("Storage Type Invalid"); - break; - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group. - try { - if (group_id >= 0) - H5.H5Gclose(group_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // close the file 2. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Re-open file 2. Needed to get the correct file size. - try { - file_id = H5.H5Fopen(FILE2, HDF5Constants.H5F_ACC_RDONLY, fapl_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Obtain and print the file size. - try { - if (file_id >= 0) { - size = H5.H5Fget_filesize(file_id); - System.out.println("File size for " + FILE2 + " is: " + size + " bytes"); - } - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close FILE2. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5Ex_G_Compact.CreateGroup(); } -} diff --git a/java/examples/groups/H5Ex_G_Corder.java b/java/examples/groups/H5Ex_G_Corder.java deleted file mode 100644 index 79bbad6..0000000 --- a/java/examples/groups/H5Ex_G_Corder.java +++ /dev/null @@ -1,118 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/************************************************************ - Creating a file with creation properties and traverse the - groups in alphabetical and creation order. - ************************************************************/ - -package examples.groups; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; -import hdf.hdf5lib.structs.H5G_info_t; - -public class H5Ex_G_Corder { - private static String FILE = "H5Ex_G_Corder.h5"; - - private static void CreateGroup() throws Exception - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long group_id = HDF5Constants.H5I_INVALID_HID; - long subgroup_id = HDF5Constants.H5I_INVALID_HID; - long gcpl_id = HDF5Constants.H5I_INVALID_HID; - int status; - H5G_info_t ginfo; - int i; - String name; - - try { - // Create a new file using default properties. - file_id = H5.H5Fcreate(FILE, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - - // Create group creation property list and enable link creation order tracking. - gcpl_id = H5.H5Pcreate(HDF5Constants.H5P_GROUP_CREATE); - status = H5.H5Pset_link_creation_order(gcpl_id, HDF5Constants.H5P_CRT_ORDER_TRACKED + - HDF5Constants.H5P_CRT_ORDER_INDEXED); - - // Create primary group using the property list. - if (status >= 0) - group_id = H5.H5Gcreate(file_id, "index_group", HDF5Constants.H5P_DEFAULT, gcpl_id, - HDF5Constants.H5P_DEFAULT); - - try { - /* - * Create subgroups in the primary group. These will be tracked by creation order. Note that - * these groups do not have to have the creation order tracking property set. - */ - subgroup_id = H5.H5Gcreate(group_id, "H", HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - status = H5.H5Gclose(subgroup_id); - subgroup_id = H5.H5Gcreate(group_id, "D", HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - status = H5.H5Gclose(subgroup_id); - subgroup_id = H5.H5Gcreate(group_id, "F", HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - status = H5.H5Gclose(subgroup_id); - subgroup_id = H5.H5Gcreate(group_id, "5", HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - status = H5.H5Gclose(subgroup_id); - - // Get group info. - ginfo = H5.H5Gget_info(group_id); - - // Traverse links in the primary group using alphabetical indices (H5_INDEX_NAME). - System.out.println("Traversing group using alphabetical indices:"); - for (i = 0; i < ginfo.nlinks; i++) { - // Retrieve the name of the ith link in a group - name = H5.H5Lget_name_by_idx(group_id, ".", HDF5Constants.H5_INDEX_NAME, - HDF5Constants.H5_ITER_INC, i, HDF5Constants.H5P_DEFAULT); - System.out.println("Index " + i + ": " + name); - } - - // Traverse links in the primary group by creation order (H5_INDEX_CRT_ORDER). - System.out.println("Traversing group using creation order indices:"); - for (i = 0; i < ginfo.nlinks; i++) { - // Retrieve the name of the ith link in a group - name = H5.H5Lget_name_by_idx(group_id, ".", HDF5Constants.H5_INDEX_CRT_ORDER, - HDF5Constants.H5_ITER_INC, i, HDF5Constants.H5P_DEFAULT); - System.out.println("Index " + i + ": " + name); - } - } - catch (Exception e) { - e.printStackTrace(); - } - } - catch (Exception e) { - e.printStackTrace(); - } - finally { - // Close and release resources. - if (gcpl_id >= 0) - H5.H5Pclose(gcpl_id); - if (group_id >= 0) - H5.H5Gclose(group_id); - if (file_id >= 0) - H5.H5Fclose(file_id); - } - } - - public static void main(String[] args) - { - try { - H5Ex_G_Corder.CreateGroup(); - } - catch (Exception ex) { - ex.printStackTrace(); - } - } -} diff --git a/java/examples/groups/H5Ex_G_Create.java b/java/examples/groups/H5Ex_G_Create.java deleted file mode 100644 index 51804b9..0000000 --- a/java/examples/groups/H5Ex_G_Create.java +++ /dev/null @@ -1,88 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - This example shows how to create, open, and close a group. - ************************************************************/ - -package examples.groups; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; - -public class H5Ex_G_Create { - private static String FILENAME = "H5Ex_G_Create.h5"; - private static String GROUPNAME = "G1"; - - private static void CreateGroup() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long group_id = HDF5Constants.H5I_INVALID_HID; - - // Create a new file using default properties. - try { - file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create a group in the file. - try { - if (file_id >= 0) - group_id = H5.H5Gcreate(file_id, "/" + GROUPNAME, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group. The handle "group" can no longer be used. - try { - if (group_id >= 0) - H5.H5Gclose(group_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Re-open the group, obtaining a new handle. - try { - if (file_id >= 0) - group_id = H5.H5Gopen(file_id, "/" + GROUPNAME, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group. - try { - if (group_id >= 0) - H5.H5Gclose(group_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5Ex_G_Create.CreateGroup(); } -} diff --git a/java/examples/groups/H5Ex_G_Intermediate.java b/java/examples/groups/H5Ex_G_Intermediate.java deleted file mode 100644 index e638fd0..0000000 --- a/java/examples/groups/H5Ex_G_Intermediate.java +++ /dev/null @@ -1,126 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - This example shows how to create intermediate groups with - a single call to H5Gcreate. - ************************************************************/ -package examples.groups; - -import java.util.ArrayList; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; -import hdf.hdf5lib.callbacks.H5O_iterate_opdata_t; -import hdf.hdf5lib.callbacks.H5O_iterate_t; -import hdf.hdf5lib.structs.H5O_info_t; - -public class H5Ex_G_Intermediate { - - private static String FILE = "H5Ex_G_Intermediate.h5"; - - private void CreateGroup() throws Exception - { - - long file_id = HDF5Constants.H5I_INVALID_HID; - long group_id = HDF5Constants.H5I_INVALID_HID; - long gcpl_id = HDF5Constants.H5I_INVALID_HID; - - try { - // Create a new file_id using the default properties. - file_id = H5.H5Fcreate(FILE, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - - // Create group_id creation property list and set it to allow creation of intermediate group_ids. - gcpl_id = H5.H5Pcreate(HDF5Constants.H5P_LINK_CREATE); - H5.H5Pset_create_intermediate_group(gcpl_id, true); - - /* - * Create the group_id /G1/G2/G3. Note that /G1 and /G1/G2 do not exist yet. This call would cause - * an error if we did not use the previously created property list. - */ - group_id = H5.H5Gcreate(file_id, "/G1/G2/G3", gcpl_id, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - // Print all the objects in the file_ids to show that intermediate group_ids have been created. - System.out.println("Objects in the file_id:"); - - // H5O_iterate_opdata_t iter_data = null; - H5O_iterate_opdata_t iter_data = new H5O_iter_data(); - H5O_iterate_t iter_cb = new H5O_iter_callback(); - - H5.H5Ovisit(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, iter_cb, - iter_data); - } - catch (Exception e) { - e.printStackTrace(); - } - finally { - // Close and release resources. - if (gcpl_id >= 0) - H5.H5Pclose(gcpl_id); - if (group_id >= 0) - H5.H5Gclose(group_id); - if (file_id >= 0) - H5.H5Fclose(file_id); - } - } - - public static void main(String[] args) - { - try { - (new H5Ex_G_Intermediate()).CreateGroup(); - } - catch (Exception ex) { - ex.printStackTrace(); - } - } - - private class idata { - public String link_name = null; - public int link_type = -1; - - idata(String name, int type) - { - this.link_name = name; - this.link_type = type; - } - } - - private class H5O_iter_data implements H5O_iterate_opdata_t { - public ArrayList<idata> iterdata = new ArrayList<idata>(); - } - - private class H5O_iter_callback implements H5O_iterate_t { - public int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data) - { - idata id = new idata(name, info.type); - ((H5O_iter_data)op_data).iterdata.add(id); - - System.out.print("/"); /* Print root group in object path */ - - // Check if the current object is the root group, and if not print the full path name and type. - - if (name.charAt(0) == '.') /* Root group, do not print '.' */ - System.out.println(" (Group)"); - else if (info.type == HDF5Constants.H5O_TYPE_GROUP) - System.out.println(name + " (Group)"); - else if (info.type == HDF5Constants.H5O_TYPE_DATASET) - System.out.println(name + " (Dataset)"); - else if (info.type == HDF5Constants.H5O_TYPE_NAMED_DATATYPE) - System.out.println(name + " (Datatype)"); - else - System.out.println(name + " (Unknown)"); - - return 0; - } - } -} diff --git a/java/examples/groups/H5Ex_G_Iterate.java b/java/examples/groups/H5Ex_G_Iterate.java deleted file mode 100644 index 24cbb0a..0000000 --- a/java/examples/groups/H5Ex_G_Iterate.java +++ /dev/null @@ -1,111 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - This example shows how to iterate over group members using - H5Gget_obj_info_all. - ************************************************************/ -package examples.groups; - -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; -import hdf.hdf5lib.structs.H5O_token_t; - -public class H5Ex_G_Iterate { - private static String FILENAME = "groups/h5ex_g_iterate.h5"; - private static String DATASETNAME = "/"; - - enum H5O_type { - H5O_TYPE_UNKNOWN(-1), // Unknown object type - H5O_TYPE_GROUP(0), // Object is a group - H5O_TYPE_DATASET(1), // Object is a dataset - H5O_TYPE_NAMED_DATATYPE(2), // Object is a named data type - H5O_TYPE_NTYPES(3); // Number of different object types - private static final Map<Integer, H5O_type> lookup = new HashMap<Integer, H5O_type>(); - - static - { - for (H5O_type s : EnumSet.allOf(H5O_type.class)) - lookup.put(s.getCode(), s); - } - - private int code; - - H5O_type(int layout_type) { this.code = layout_type; } - - public int getCode() { return this.code; } - - public static H5O_type get(int code) { return lookup.get(code); } - } - - private static void do_iterate() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - - // Open a file using default properties. - try { - file_id = H5.H5Fopen(FILENAME, HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Begin iteration. - System.out.println("Objects in root group:"); - try { - if (file_id >= 0) { - int count = (int)H5.H5Gn_members(file_id, DATASETNAME); - String[] oname = new String[count]; - int[] otype = new int[count]; - int[] ltype = new int[count]; - H5O_token_t[] otokens = new H5O_token_t[count]; - H5.H5Gget_obj_info_all(file_id, DATASETNAME, oname, otype, ltype, otokens, - HDF5Constants.H5_INDEX_NAME); - - // Get type of the object and display its name and type. - for (int indx = 0; indx < otype.length; indx++) { - switch (H5O_type.get(otype[indx])) { - case H5O_TYPE_GROUP: - System.out.println(" Group: " + oname[indx]); - break; - case H5O_TYPE_DATASET: - System.out.println(" Dataset: " + oname[indx]); - break; - case H5O_TYPE_NAMED_DATATYPE: - System.out.println(" Datatype: " + oname[indx]); - break; - default: - System.out.println(" Unknown: " + oname[indx]); - } - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5Ex_G_Iterate.do_iterate(); } -} diff --git a/java/examples/groups/H5Ex_G_Phase.java b/java/examples/groups/H5Ex_G_Phase.java deleted file mode 100644 index 7a3fba3..0000000 --- a/java/examples/groups/H5Ex_G_Phase.java +++ /dev/null @@ -1,235 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - This example shows how to set the conditions for - conversion between compact and dense (indexed) groups. - ************************************************************/ -package examples.groups; - -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; -import hdf.hdf5lib.structs.H5G_info_t; - -public class H5Ex_G_Phase { - private static String FILE = "H5Ex_G_Phase.h5"; - private static int MAX_GROUPS = 7; - private static int MAX_COMPACT = 5; - private static int MIN_DENSE = 3; - - enum H5G_storage { - H5G_STORAGE_TYPE_UNKNOWN(-1), - H5G_STORAGE_TYPE_SYMBOL_TABLE(0), - H5G_STORAGE_TYPE_COMPACT(1), - H5G_STORAGE_TYPE_DENSE(2); - - private static final Map<Integer, H5G_storage> lookup = new HashMap<Integer, H5G_storage>(); - - static - { - for (H5G_storage s : EnumSet.allOf(H5G_storage.class)) - lookup.put(s.getCode(), s); - } - - private int code; - - H5G_storage(int layout_type) { this.code = layout_type; } - - public int getCode() { return this.code; } - - public static H5G_storage get(int code) { return lookup.get(code); } - } - - private static void CreateGroup() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long group_id = HDF5Constants.H5I_INVALID_HID; - long subgroup_id = HDF5Constants.H5I_INVALID_HID; - long fapl_id = HDF5Constants.H5I_INVALID_HID; - long gcpl_id = HDF5Constants.H5I_INVALID_HID; - H5G_info_t ginfo; - String name = "G0"; // Name of subgroup_id - int i; - - // Set file access property list to allow the latest file format.This will allow the library to create - // new format groups. - try { - fapl_id = H5.H5Pcreate(HDF5Constants.H5P_FILE_ACCESS); - if (fapl_id >= 0) - H5.H5Pset_libver_bounds(fapl_id, HDF5Constants.H5F_LIBVER_LATEST, - HDF5Constants.H5F_LIBVER_LATEST); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create group access property list and set the phase change conditions. - try { - gcpl_id = H5.H5Pcreate(HDF5Constants.H5P_GROUP_CREATE); - if (gcpl_id >= 0) - H5.H5Pset_link_phase_change(gcpl_id, MAX_COMPACT, MIN_DENSE); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create a new file using the default properties. - try { - if (fapl_id >= 0) - file_id = H5.H5Fcreate(FILE, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, fapl_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create primary group. - try { - if ((file_id >= 0) && (gcpl_id >= 0)) - group_id = H5.H5Gcreate(file_id, name, HDF5Constants.H5P_DEFAULT, gcpl_id, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Add subgroups to "group" one at a time, print the storage type for "group" after each subgroup is - // created. - for (i = 1; i <= MAX_GROUPS; i++) { - // Define the subgroup name and create the subgroup. - char append = (char)(((char)i) + '0'); - name = name + append; /* G1, G2, G3 etc. */ - try { - if (group_id >= 0) { - subgroup_id = H5.H5Gcreate(group_id, name, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - H5.H5Gclose(subgroup_id); - } - } - catch (Exception e) { - e.printStackTrace(); - } - - // Obtain the group info and print the group storage type - try { - if (group_id >= 0) { - ginfo = H5.H5Gget_info(group_id); - System.out.print(ginfo.nlinks + " Group" + (ginfo.nlinks == 1 ? " " : "s") + - ": Storage type is "); - switch (H5G_storage.get(ginfo.storage_type)) { - case H5G_STORAGE_TYPE_COMPACT: - System.out.println("H5G_STORAGE_TYPE_COMPACT"); // New compact format - break; - case H5G_STORAGE_TYPE_DENSE: - System.out.println("H5G_STORAGE_TYPE_DENSE"); // New dense (indexed) format - break; - case H5G_STORAGE_TYPE_SYMBOL_TABLE: - System.out.println("H5G_STORAGE_TYPE_SYMBOL_TABLE"); // Original format - break; - case H5G_STORAGE_TYPE_UNKNOWN: - System.out.println("H5G_STORAGE_TYPE_UNKNOWN"); - break; - default: - System.out.println("Storage Type Invalid"); - break; - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - } - - System.out.println(); - - // Delete subgroups one at a time, print the storage type for "group" after each subgroup is deleted. - for (i = MAX_GROUPS; i >= 1; i--) { - // Define the subgroup name and delete the subgroup. - try { - H5.H5Ldelete(group_id, name, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - name = name.substring(0, i + 1); - - // Obtain the group info and print the group storage type - try { - if (group_id >= 0) { - ginfo = H5.H5Gget_info(group_id); - System.out.print(ginfo.nlinks + " Group" + (ginfo.nlinks == 1 ? " " : "s") + - ": Storage type is "); - switch (H5G_storage.get(ginfo.storage_type)) { - case H5G_STORAGE_TYPE_COMPACT: - System.out.println("H5G_STORAGE_TYPE_COMPACT"); // New compact format - break; - case H5G_STORAGE_TYPE_DENSE: - System.out.println("H5G_STORAGE_TYPE_DENSE"); // New dense (indexed) format - break; - case H5G_STORAGE_TYPE_SYMBOL_TABLE: - System.out.println("H5G_STORAGE_TYPE_SYMBOL_TABLE"); // Original format - break; - case H5G_STORAGE_TYPE_UNKNOWN: - System.out.println("H5G_STORAGE_TYPE_UNKNOWN"); - break; - default: - System.out.println("Storage Type Invalid"); - break; - } - } - } - catch (Exception e) { - e.printStackTrace(); - } - } - - // Close and release resources - try { - if (fapl_id >= 0) - H5.H5Pclose(fapl_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - try { - if (gcpl_id >= 0) - H5.H5Pclose(gcpl_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group - try { - if (group_id >= 0) - H5.H5Gclose(group_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5Ex_G_Phase.CreateGroup(); } -} diff --git a/java/examples/groups/H5Ex_G_Traverse.java b/java/examples/groups/H5Ex_G_Traverse.java deleted file mode 100644 index 61a269c..0000000 --- a/java/examples/groups/H5Ex_G_Traverse.java +++ /dev/null @@ -1,167 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ -This example shows a way to recursively traverse the file -using H5Literate. The method shown here guarantees that -the recursion will not enter an infinite loop, but does -not prevent objects from being visited more than once. -The program prints the directory structure of the file -specified in FILE. The default file used by this example -implements the structure described in the User's Guide, -chapter 4, figure 26. - ************************************************************/ -package examples.groups; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; -import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t; -import hdf.hdf5lib.callbacks.H5L_iterate_t; -import hdf.hdf5lib.structs.H5L_info_t; -import hdf.hdf5lib.structs.H5O_info_t; - -import examples.groups.H5Ex_G_Iterate.H5O_type; - -class opdata implements H5L_iterate_opdata_t { - int recurs; - opdata prev; - H5O_token_t obj_token; -} - -public class H5Ex_G_Traverse { - - private static String FILE = "h5ex_g_traverse.h5"; - public static H5L_iterate_t iter_cb = new H5L_iter_callbackT(); - - private static void OpenGroup() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - H5O_info_t infobuf; - opdata od = new opdata(); - - // Open file and initialize the operator data structure. - try { - file_id = H5.H5Fopen(FILE, HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); - if (file_id >= 0) { - infobuf = H5.H5Oget_info(file_id); - od.recurs = 0; - od.prev = null; - od.obj_token = infobuf.token; - } - } - catch (Exception e) { - e.printStackTrace(); - } - - // Print the root group and formatting, begin iteration. - try { - System.out.println("/ {"); - // H5L_iterate_t iter_cb = new H5L_iter_callbackT(); - H5.H5Literate(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, 0L, iter_cb, - od); - System.out.println("}"); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close and release resources. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5Ex_G_Traverse.OpenGroup(); } -} - -class H5L_iter_callbackT implements H5L_iterate_t { - public int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data) - { - - H5O_info_t infobuf; - int return_val = 0; - opdata od = (opdata)op_data; // Type conversion - int spaces = 2 * (od.recurs + 1); // Number of white spaces to prepend to output. - - // Get type of the object and display its name and type. - // The name of the object is passed to this function by the Library. - try { - infobuf = H5.H5Oget_info_by_name(group, name, HDF5Constants.H5P_DEFAULT); - - for (int i = 0; i < spaces; i++) - System.out.print(" "); // Format output. - switch (H5O_type.get(infobuf.type)) { - case H5O_TYPE_GROUP: - System.out.println("Group: " + name + " { "); - // Check group object token against linked list of operator - // data structures. We will always run the check, as the - // reference count cannot be relied upon if there are - // symbolic links, and H5Oget_info_by_name always follows - // symbolic links. Alternatively we could use H5Lget_info - // and never recurse on groups discovered by symbolic - // links, however it could still fail if an object's - // reference count was manually manipulated with - // H5Odecr_refcount. - if (group_check(od, infobuf.token)) { - for (int i = 0; i < spaces; i++) - System.out.print(" "); - System.out.println(" Warning: Loop detected!"); - } - else { - // Initialize new object of type opdata and begin - // recursive iteration on the discovered - // group. The new opdata is given a pointer to the - // current one. - opdata nextod = new opdata(); - nextod.recurs = od.recurs + 1; - nextod.prev = od; - nextod.obj_token = infobuf.token; - H5L_iterate_t iter_cb2 = new H5L_iter_callbackT(); - return_val = H5.H5Literate_by_name(group, name, HDF5Constants.H5_INDEX_NAME, - HDF5Constants.H5_ITER_NATIVE, 0L, iter_cb2, nextod, - HDF5Constants.H5P_DEFAULT); - } - for (int i = 0; i < spaces; i++) - System.out.print(" "); - System.out.println("}"); - break; - case H5O_TYPE_DATASET: - System.out.println("Dataset: " + name); - break; - case H5O_TYPE_NAMED_DATATYPE: - System.out.println("Datatype: " + name); - break; - default: - System.out.println("Unknown: " + name); - } - } - catch (Exception e) { - e.printStackTrace(); - } - - return return_val; - } - - public boolean group_check(opdata od, H5O_token_t target_token) - { - if (od.obj_token.equals(target_token)) - return true; // Object tokens match - else if (od.recurs == 0) - return false; // Root group reached with no matches - else - return group_check(od.prev, target_token); // Recursively examine the next node - } -} diff --git a/java/examples/groups/H5Ex_G_Visit.java b/java/examples/groups/H5Ex_G_Visit.java deleted file mode 100644 index 1f2f9a1..0000000 --- a/java/examples/groups/H5Ex_G_Visit.java +++ /dev/null @@ -1,154 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - This example shows how to recursively traverse a file - using H5Ovisit and H5Lvisit. The program prints all of - the objects in the file specified in FILE, then prints all - of the links in that file. The default file used by this - example implements the structure described in the User - Guide, chapter 4, figure 26. - ************************************************************/ -package examples.groups; - -import java.util.ArrayList; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; -import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t; -import hdf.hdf5lib.callbacks.H5L_iterate_t; -import hdf.hdf5lib.callbacks.H5O_iterate_opdata_t; -import hdf.hdf5lib.callbacks.H5O_iterate_t; -import hdf.hdf5lib.structs.H5L_info_t; -import hdf.hdf5lib.structs.H5O_info_t; - -public class H5Ex_G_Visit { - - private static String FILE = "groups/h5ex_g_visit.h5"; - - public static void main(String[] args) - { - try { - (new H5Ex_G_Visit()).VisitGroup(); - } - catch (Exception ex) { - ex.printStackTrace(); - } - } - - private void VisitGroup() throws Exception - { - - long file_id = HDF5Constants.H5I_INVALID_HID; - - try { - // Open file - file_id = H5.H5Fopen(FILE, HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); - - // Begin iteration using H5Ovisit - System.out.println("Objects in the file:"); - H5O_iterate_opdata_t iter_data = new H5O_iter_data(); - H5O_iterate_t iter_cb = new H5O_iter_callback(); - H5.H5Ovisit(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, iter_cb, - iter_data); - System.out.println(); - // Repeat the same process using H5Lvisit - H5L_iterate_opdata_t iter_data2 = new H5L_iter_data(); - H5L_iterate_t iter_cb2 = new H5L_iter_callback(); - System.out.println("Links in the file:"); - H5.H5Lvisit(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, iter_cb2, - iter_data2); - } - catch (Exception e) { - e.printStackTrace(); - } - finally { - // Close and release resources. - if (file_id >= 0) - H5.H5Fclose(file_id); - } - } - - /************************************************************ - * Operator function for H5Lvisit. This function simply retrieves the info for the object the current link - *points to, and calls the operator function for H5Ovisit. - ************************************************************/ - - private class idata { - public String link_name = null; - public int link_type = -1; - - idata(String name, int type) - { - this.link_name = name; - this.link_type = type; - } - } - - private class H5L_iter_data implements H5L_iterate_opdata_t { - public ArrayList<idata> iterdata = new ArrayList<idata>(); - } - - private class H5L_iter_callback implements H5L_iterate_t { - public int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data) - { - - idata id = new idata(name, info.type); - ((H5L_iter_data)op_data).iterdata.add(id); - - H5O_info_t infobuf; - int ret = 0; - try { - // Get type of the object and display its name and type. The name of the object is passed to - // this function by the Library. - infobuf = H5.H5Oget_info_by_name(group, name, HDF5Constants.H5P_DEFAULT); - H5O_iterate_t iter_cbO = new H5O_iter_callback(); - H5O_iterate_opdata_t iter_dataO = new H5O_iter_data(); - ret = iter_cbO.callback(group, name, infobuf, iter_dataO); - } - catch (Exception e) { - e.printStackTrace(); - } - - return ret; - } - } - - private class H5O_iter_data implements H5O_iterate_opdata_t { - public ArrayList<idata> iterdata = new ArrayList<idata>(); - } - - private class H5O_iter_callback implements H5O_iterate_t { - public int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data) - { - idata id = new idata(name, info.type); - ((H5O_iter_data)op_data).iterdata.add(id); - - System.out.print("/"); /* Print root group in object path */ - - // Check if the current object is the root group, and if not print the full path name and type. - - if (name.charAt(0) == '.') /* Root group, do not print '.' */ - System.out.println(" (Group)"); - else if (info.type == HDF5Constants.H5O_TYPE_GROUP) - System.out.println(name + " (Group)"); - else if (info.type == HDF5Constants.H5O_TYPE_DATASET) - System.out.println(name + " (Dataset)"); - else if (info.type == HDF5Constants.H5O_TYPE_NAMED_DATATYPE) - System.out.println(name + " (Datatype)"); - else - System.out.println(name + " (Unknown)"); - - return 0; - } - } -} diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in deleted file mode 100644 index 4773579..0000000 --- a/java/examples/groups/JavaGroupExample.sh.in +++ /dev/null @@ -1,381 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -top_builddir=@top_builddir@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ -IS_DARWIN="@H5_IS_DARWIN@" - -TESTNAME=EX_Groups -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -# Set up default variable values if not supplied by the user. -RM='rm -rf' -CMP='cmp' -DIFF='diff -c' -CP='cp' -DIRNAME='dirname' -BASENAME='basename' -LS='ls' -AWK='awk' - -nerrors=0 - -# where the libs exist -HDFLIB_HOME="$top_srcdir/java/lib" -BLDDIR="." -BLDLIBDIR="$BLDDIR/testlibs" -BLDITERDIR="./groups" -HDFTEST_HOME="$top_srcdir/java/examples/groups" -JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar -TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar -test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR -test -d $BLDITERDIR || mkdir -p $BLDITERDIR - -###################################################################### -# library files -# -------------------------------------------------------------------- -# All the library files copy from source directory to test directory -# NOTE: Keep this framework to add/remove test files. -# This list are also used for checking exist. -# Comment '#' without space can be used. -# -------------------------------------------------------------------- -LIST_LIBRARY_FILES=" -$top_builddir/src/.libs/libhdf5.* -$top_builddir/java/src/jni/.libs/libhdf5_java.* -$top_builddir/java/src/$JARFILE -" -LIST_JAR_TESTFILES=" -$HDFLIB_HOME/slf4j-api-2.0.6.jar -$HDFLIB_HOME/ext/slf4j-simple-2.0.6.jar -" -LIST_ITER_FILES=" -$HDFTEST_HOME/h5ex_g_iterate.h5 -$HDFTEST_HOME/h5ex_g_visit.h5 -" -LIST_DATA_FILES=" -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Create.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Iterate.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Compact.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Corder.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Intermediate.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Phase.txt -$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Visit.txt -" - -# -# copy files from source dirs to test dir -# -COPY_LIBFILES="$LIST_LIBRARY_FILES" -COPY_JARTESTFILES="$LIST_JAR_TESTFILES" - -COPY_LIBFILES_TO_BLDLIBDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_LIBFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -fR $tstfile $BLDLIBDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - BNAME=`$BASENAME $tstfile` - if [ "$BNAME" = "libhdf5_java.dylib" ]; then - COPIED_LIBHDF5_JAVA=1 - fi - fi - fi - done - if [[ "$IS_DARWIN" = "yes" ]] && [[ $COPIED_LIBHDF5_JAVA -eq 1 ]]; then - (cd $BLDLIBDIR; \ - install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \ - exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \ - echo $exist_path; \ - install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib) - fi - # copy jar files. Used -f to make sure get a new copy - for tstfile in $COPY_JARTESTFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -fR $tstfile $BLDLIBDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_LIBFILES_AND_BLDLIBDIR() -{ - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=$HDFLIB_HOME - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM -rf $BLDLIBDIR - fi -} - -COPY_DATAFILES="$LIST_DATA_FILES" - -COPY_DATAFILES_TO_BLDDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_DATAFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_DATAFILES_AND_BLDDIR() -{ - $RM $BLDDIR/examples.groups.H5Ex_G_*.txt - $RM $BLDDIR/H5Ex_G_*.out - $RM $BLDDIR/H5Ex_G_*.h5 -} - -COPY_ITERFILES="$LIST_ITER_FILES" - -COPY_ITERFILES_TO_BLDITERDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_ITERFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDITERDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDITERDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_ITERFILES_AND_BLDITERDIR() -{ - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $HDFTEST_HOME/h5ex_g_iterate.h5` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDITERDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM $BLDITERDIR - fi -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# where Java is installed (requires jdk1.7.x) -JAVAEXE=@JAVA@ -JAVAEXEFLAGS=@H5_JAVAFLAGS@ - -############################################################################### -# DO NOT MODIFY BELOW THIS LINE -############################################################################### - -# prepare for test -COPY_LIBFILES_TO_BLDLIBDIR -COPY_DATAFILES_TO_BLDDIR -COPY_ITERFILES_TO_BLDITERDIR - -CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-2.0.6.jar:"$BLDLIBDIR"/slf4j-simple-2.0.6.jar:"$TESTJARFILE"" - -TEST=/usr/bin/test -if [ ! -x /usr/bin/test ] -then -TEST=`which test` -fi - -if $TEST -z "$CLASSPATH"; then - CLASSPATH="" -fi -CLASSPATH=$CPATH":"$CLASSPATH -export CLASSPATH - -if $TEST -n "$JAVAPATH" ; then - PATH=$JAVAPATH":"$PATH - export PATH -fi - -if $TEST -e /bin/uname; then - os_name=`/bin/uname -s` -elif $TEST -e /usr/bin/uname; then - os_name=`/usr/bin/uname -s` -else - os_name=unknown -fi - -if $TEST -z "$LD_LIBRARY_PATH" ; then - LD_LIBRARY_PATH="" -fi - -case $os_name in - *) - LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH - ;; -esac - -export LD_LIBRARY_PATH - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create" -TESTING examples.groups.H5Ex_G_Create -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Create > H5Ex_G_Create.out) -if diff H5Ex_G_Create.out examples.groups.H5Ex_G_Create.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Create" -else - echo "**FAILED** groups.H5Ex_G_Create" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate" -TESTING examples.groups.H5Ex_G_Iterate -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Iterate > H5Ex_G_Iterate.out) -if diff H5Ex_G_Iterate.out examples.groups.H5Ex_G_Iterate.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Iterate" -else - echo "**FAILED** groups.H5Ex_G_Iterate" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact" -TESTING examples.groups.H5Ex_G_Compact -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Compact > H5Ex_G_Compact.out) -if diff H5Ex_G_Compact.out examples.groups.H5Ex_G_Compact.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Compact" -else - echo "**FAILED** groups.H5Ex_G_Compact" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder" -TESTING examples.groups.H5Ex_G_Corder -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Corder > H5Ex_G_Corder.out) -if diff H5Ex_G_Corder.out examples.groups.H5Ex_G_Corder.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Corder" -else - echo "**FAILED** groups.H5Ex_G_Corder" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate" -TESTING examples.groups.H5Ex_G_Intermediate -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Intermediate > H5Ex_G_Intermediate.out) -if diff H5Ex_G_Intermediate.out examples.groups.H5Ex_G_Intermediate.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Intermediate" -else - echo "**FAILED** groups.H5Ex_G_Intermediate" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase" -TESTING examples.groups.H5Ex_G_Phase -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Phase > H5Ex_G_Phase.out) -if diff H5Ex_G_Phase.out examples.groups.H5Ex_G_Phase.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Phase" -else - echo "**FAILED** groups.H5Ex_G_Phase" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit" -TESTING examples.groups.H5Ex_G_Visit -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.groups.H5Ex_G_Visit > H5Ex_G_Visit.out) -if diff H5Ex_G_Visit.out examples.groups.H5Ex_G_Visit.txt > /dev/null; then - echo " PASSED groups.H5Ex_G_Visit" -else - echo "**FAILED** groups.H5Ex_G_Visit" - nerrors="`expr $nerrors + 1`" -fi - -# Clean up temporary files/directories -CLEAN_ITERFILES_AND_BLDITERDIR -CLEAN_LIBFILES_AND_BLDLIBDIR -CLEAN_DATAFILES_AND_BLDDIR - -# Report test results and exit -if test $nerrors -eq 0 ; then - echo "All $TESTNAME tests passed." - exit $EXIT_SUCCESS -else - echo "$TESTNAME tests failed with $nerrors errors." - exit $EXIT_FAILURE -fi diff --git a/java/examples/groups/Makefile.am b/java/examples/groups/Makefile.am deleted file mode 100644 index a3fb774..0000000 --- a/java/examples/groups/Makefile.am +++ /dev/null @@ -1,65 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -## -## Makefile.am -## Run automake to generate a Makefile.in from this file. -## -# -# HDF5 Java Library Examples Makefile(.in) - -include $(top_srcdir)/config/commence.am - -# Mark this directory as part of the JNI API -JAVA_API=yes - -JAVAROOT = .classes - -classes: - test -d $(@D)/$(JAVAROOT) || $(MKDIR_P) $(@D)/$(JAVAROOT) - -pkgpath = examples/groups -hdfjarfile = jar$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).jar -CLASSPATH_ENV=CLASSPATH=.:$(JAVAROOT):$(top_builddir)/java/src/$(hdfjarfile):$(top_srcdir)/java/lib/slf4j-api-2.0.6.jar:$(top_srcdir)/java/lib/ext/slf4j-simple-2.0.6.jar:$$CLASSPATH - -jarfile = jar$(PACKAGE_TARNAME)groups.jar - -AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation - -TESTPACKAGE = - -noinst_JAVA = \ - H5Ex_G_Create.java \ - H5Ex_G_Iterate.java \ - H5Ex_G_Compact.java \ - H5Ex_G_Corder.java \ - H5Ex_G_Intermediate.java \ - H5Ex_G_Phase.java \ - H5Ex_G_Visit.java - - -$(jarfile): classnoinst.stamp classes - $(JAR) cvf $@ -C $(JAVAROOT)/ $(pkgpath) - -noinst_DATA = $(jarfile) - -.PHONY: classes - -check_SCRIPTS = JavaGroupExample.sh -TEST_SCRIPT = $(check_SCRIPTS) - -CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class JavaGroupExample.sh - -clean: - rm -rf $(JAVAROOT)/* - rm -f $(jarfile) - rm -f classnoinst.stamp - -include $(top_srcdir)/config/conclude.am diff --git a/java/examples/groups/h5ex_g_iterate.h5 b/java/examples/groups/h5ex_g_iterate.h5 Binary files differdeleted file mode 100644 index e462703..0000000 --- a/java/examples/groups/h5ex_g_iterate.h5 +++ /dev/null diff --git a/java/examples/groups/h5ex_g_visit.h5 b/java/examples/groups/h5ex_g_visit.h5 Binary files differdeleted file mode 100644 index d8267b1..0000000 --- a/java/examples/groups/h5ex_g_visit.h5 +++ /dev/null |