From 381f3966ae636f47bd255a7dbf55203e75902e79 Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <andreas.romeyke@slub-dresden.de> Date: Tue, 21 Oct 2014 10:35:01 +0000 Subject: [PATCH] - because Rosetta4.0 comes with massive changes on NFSStoragePlugin, we decided to remove dependencies to this plugin, but use them as source for our variant. --- .idea/ant.xml | 3 + .idea/compiler.xml | 1 + .idea/copyright/profiles_settings.xml | 4 +- .idea/libraries/NFSStoragePlugin.xml | 9 - .idea/libraries/dps_sdk_3_2_2.xml | 9 - .idea/libraries/dps_sdk_4_0_0.xml | 24 ++ .idea/workspace.xml | 278 ++++++++++----- Makefile | 2 +- PLUGIN-INF/metadata_SLUBStoragepPlugin.xml | 2 +- .../plugin/storage/nfs/SLUBStoragePlugin.java | 336 +++++++++++++++++- 10 files changed, 547 insertions(+), 121 deletions(-) create mode 100644 .idea/ant.xml delete mode 100644 .idea/libraries/NFSStoragePlugin.xml delete mode 100644 .idea/libraries/dps_sdk_3_2_2.xml create mode 100644 .idea/libraries/dps_sdk_4_0_0.xml diff --git a/.idea/ant.xml b/.idea/ant.xml new file mode 100644 index 0000000..f6e673a --- /dev/null +++ b/.idea/ant.xml @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4" /> + diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 217af47..da84ac3 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,6 +18,7 @@ <processorPath useClasspath="true" /> </profile> </annotationProcessing> + <bytecodeTargetLevel target="1.6" /> </component> </project> diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml index 3572571..e7bedf3 100644 --- a/.idea/copyright/profiles_settings.xml +++ b/.idea/copyright/profiles_settings.xml @@ -1,5 +1,3 @@ <component name="CopyrightManager"> - <settings default=""> - <module2copyright /> - </settings> + <settings default="" /> </component> \ No newline at end of file diff --git a/.idea/libraries/NFSStoragePlugin.xml b/.idea/libraries/NFSStoragePlugin.xml deleted file mode 100644 index c49823c..0000000 --- a/.idea/libraries/NFSStoragePlugin.xml +++ /dev/null @@ -1,9 +0,0 @@ -<component name="libraryTable"> - <library name="NFSStoragePlugin"> - <CLASSES> - <root url="jar:///exlibris/dps/d4_1/system.dir/bundled_plugins/NFSStoragePlugin.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/dps_sdk_3_2_2.xml b/.idea/libraries/dps_sdk_3_2_2.xml deleted file mode 100644 index 9029019..0000000 --- a/.idea/libraries/dps_sdk_3_2_2.xml +++ /dev/null @@ -1,9 +0,0 @@ -<component name="libraryTable"> - <library name="dps-sdk-3.2.2"> - <CLASSES> - <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-3.2.2/lib/dps-sdk-3.2.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> -</component> \ No newline at end of file diff --git a/.idea/libraries/dps_sdk_4_0_0.xml b/.idea/libraries/dps_sdk_4_0_0.xml new file mode 100644 index 0000000..848d483 --- /dev/null +++ b/.idea/libraries/dps_sdk_4_0_0.xml @@ -0,0 +1,24 @@ +<component name="libraryTable"> + <library name="dps-sdk-4.0.0"> + <CLASSES> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/lib/dps-sdk-4.0.0.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/axis.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/commons-httpclient-3.1.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/commons-io-2.0.1.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/commons-lang-2.6.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/httpclient-4.1.2.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/httpcore-4.1.2.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/jackson-core-asl-1.5.2.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/jhove-1.10.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/jhove-handler-1.10.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/jhove-module-1.10.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/json-simple-1.1.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/xmlbeans-2.3.0.jar!/" /> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/dps-sdk-projects/dps-sdk-plugins/resources/lib/zip4j-1.3.2.jar!/" /> + </CLASSES> + <JAVADOC> + <root url="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/lib/dps-sdk-4.0.0-javadoc.jar!/" /> + </JAVADOC> + <SOURCES /> + </library> +</component> \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a93bb16..fbda5a0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,15 @@ <project version="4"> <component name="ChangeListManager"> <list default="true" readonly="true" id="3ad7d15b-0167-4c60-a3f9-2d3c54aea812" name="Default" comment=""> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/ant.xml" /> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/libraries/dps_sdk_4_0_0.xml" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/.idea/libraries/NFSStoragePlugin.xml" afterPath="" /> + <change type="DELETED" beforePath="$PROJECT_DIR$/.idea/libraries/dps_sdk_3_2_2.xml" afterPath="" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Makefile" afterPath="$PROJECT_DIR$/Makefile" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java" afterPath="$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/compiler.xml" afterPath="$PROJECT_DIR$/.idea/compiler.xml" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/copyright/profiles_settings.xml" afterPath="$PROJECT_DIR$/.idea/copyright/profiles_settings.xml" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> </list> <ignored path="StoragePlugin4Rosetta.iws" /> <ignored path=".idea/workspace.xml" /> @@ -13,6 +21,14 @@ <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> + <component name="Commander"> + <leftPanel /> + <rightPanel /> + <splitter proportion="0.5" /> + </component> + <component name="CompilerWorkspaceConfiguration"> + <option name="MAKE_PROJECT_ON_SAVE" value="true" /> + </component> <component name="CreatePatchCommitExecutor"> <option name="PATCH_PATH" value="" /> </component> @@ -20,7 +36,7 @@ <disable_hints /> </component> <component name="DebuggerManager"> - <breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true"> + <breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true" converted="true"> <breakpoint> <option name="NOTIFY_CAUGHT" value="true" /> <option name="NOTIFY_UNCAUGHT" value="true" /> @@ -56,9 +72,8 @@ <option name="LOG_MESSAGE" value="" /> </breakpoint> </breakpoint_any> - <ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" /> - <breakpoint_rules /> - <ui_properties /> + <breakpoint_rules converted="true" /> + <ui_properties converted="true" /> </component> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="FavoritesManager"> @@ -69,9 +84,30 @@ <file leaf-file-name="SLUBStoragePlugin.java" pinned="false" current="true" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="45" column="2" selection-start="1651" selection-end="1651" vertical-scroll-proportion="-0.8016627" vertical-offset="1080" max-vertical-offset="2670"> + <state vertical-scroll-proportion="0.6167883" vertical-offset="6457" max-vertical-offset="7005"> + <caret line="453" column="5" selection-start-line="453" selection-start-column="5" selection-end-line="453" selection-end-column="5" /> + <folding> + <element signature="e#0#19071#0" expanded="true" /> + <element signature="imports" expanded="true" /> + <element signature="e#2675#2676#0" expanded="true" /> + <element signature="e#2727#2728#0" expanded="true" /> + <element signature="e#3607#3608#0" expanded="true" /> + <element signature="e#3669#3670#0" expanded="true" /> + <element signature="e#18552#18568#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="NFSStoragePlugin.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/NFSStoragePlugin.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="-12.555555" vertical-offset="2586" max-vertical-offset="6885"> + <caret line="195" column="0" selection-start-line="185" selection-start-column="2" selection-end-line="195" selection-end-column="0" /> <folding> <element signature="imports" expanded="true" /> + <element signature="e#12505#12506#0" expanded="true" /> + <element signature="e#12561#12562#0" expanded="true" /> </folding> </state> </provider> @@ -87,14 +123,18 @@ <component name="IdeDocumentHistory"> <option name="changedFiles"> <list> + <option value="$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/NFSStoragePlugin.java" /> <option value="$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java" /> </list> </option> </component> + <component name="MavenProjectNavigator"> + <treeState /> + </component> <component name="ProjectFrameBounds"> - <option name="x" value="201" /> - <option name="y" value="66" /> - <option name="width" value="1400" /> + <option name="x" value="88" /> + <option name="y" value="68" /> + <option name="width" value="1594" /> <option name="height" value="1000" /> </component> <component name="ProjectInspectionProfilesVisibleTreeState"> @@ -130,7 +170,7 @@ <option name="STATE" value="0" /> </component> <component name="ProjectView"> - <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5"> + <navigator currentView="ProjectPane" proportions="" version="1"> <flattenPackages /> <showMembers /> <showModules /> @@ -142,6 +182,7 @@ <sortByType /> </navigator> <panes> + <pane id="Scope" /> <pane id="ProjectPane"> <subPane> <PATH> @@ -150,37 +191,8 @@ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="StoragePlugin4Rosetta" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="slub" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="StoragePlugin4Rosetta" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="slub" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="rosetta" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="nfs" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> </subPane> </pane> - <pane id="Scope" /> <pane id="PackagesPane" /> </panes> </component> @@ -191,18 +203,26 @@ <property name="MemberChooser.sorted" value="false" /> <property name="MemberChooser.showClasses" value="true" /> <property name="MemberChooser.copyJavadoc" value="false" /> - <property name="options.lastSelected" value="preferences.sourceCode.Java" /> + <property name="options.lastSelected" value="project.propCompiler" /> <property name="options.splitter.main.proportions" value="0.3" /> <property name="options.splitter.details.proportions" value="0.2" /> <property name="options.searchVisible" value="true" /> - <property name="last_opened_file_path" value="/exlibris/dps/d4_1/system.dir/bundled_plugins/NFSStoragePlugin.jar!/" /> - <property name="project.structure.last.edited" value="Libraries" /> - <property name="project.structure.proportion" value="0.0" /> - <property name="project.structure.side.proportion" value="0.0" /> + <property name="last_opened_file_path" value="/usr/lib/jvm/java-7-openjdk-amd64/src.zip!/" /> + <property name="project.structure.last.edited" value="SDKs" /> + <property name="project.structure.proportion" value="0.15" /> + <property name="project.structure.side.proportion" value="0.2" /> <property name="FullScreen" value="false" /> + <property name="recentsLimit" value="5" /> + <property name="GenerateAntBuildDialog.generateSingleFile" value="true" /> + <property name="GenerateAntBuildDialog.enableUiFormCompile" value="true" /> + <property name="GenerateAntBuildDialog.forceTargetJdk" value="true" /> + <property name="GenerateAntBuildDialog.backupFiles" value="true" /> + <property name="GenerateAntBuildDialog.inclineRuntiemClasspath" value="false" /> + <property name="GenerateAntBuildDialog.generateIdeaHomeProperty" value="false" /> + <property name="GenerateAntBuildDialog.outputFileNameProperty" value="storageplugin4rosetta" /> </component> <component name="RunManager"> - <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin" singleton="true"> + <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin"> <module name="" /> <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" /> <option name="PROGRAM_PARAMETERS" /> @@ -297,23 +317,8 @@ </configuration> </component> <component name="ShelveChangesManager" show_recycled="false" /> - <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="true" SSL_PROTOCOLS="all"> - <option name="USER" value="" /> - <option name="PASSWORD" value="" /> - <option name="mySSHConnectionTimeout" value="30000" /> - <option name="mySSHReadTimeout" value="30000" /> - <option name="LAST_MERGED_REVISION" /> - <option name="MERGE_DRY_RUN" value="false" /> - <option name="MERGE_DIFF_USE_ANCESTRY" value="true" /> - <option name="UPDATE_LOCK_ON_DEMAND" value="false" /> - <option name="IGNORE_SPACES_IN_MERGE" value="false" /> - <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" /> - <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" /> - <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" /> - <option name="FORCE_UPDATE" value="false" /> - <option name="IGNORE_EXTERNALS" value="false" /> + <component name="SvnConfiguration" myUseAcceleration="nothing" cleanupOnStartRun="true"> <configuration useDefault="false">$USER_HOME$/.subversion</configuration> - <myIsUseDefaultProxy>false</myIsUseDefaultProxy> <supportedVersion>125</supportedVersion> </component> <component name="SvnFileUrlMappingImpl"> @@ -324,8 +329,8 @@ <option name="myCopyRoot" value="$PROJECT_DIR$" /> </SvnCopyRootSimple> <SvnCopyRootSimple> - <option name="myVcsRoot" value="$PROJECT_DIR$/java/org/slub" /> - <option name="myCopyRoot" value="$PROJECT_DIR$/java/org/slub" /> + <option name="myVcsRoot" value="$PROJECT_DIR$/.idea" /> + <option name="myCopyRoot" value="$PROJECT_DIR$/.idea" /> </SvnCopyRootSimple> </list> </option> @@ -346,36 +351,62 @@ </task> <servers /> </component> + <component name="TodoView" selected-index="0"> + <todo-panel id="selected-file"> + <are-packages-shown value="false" /> + <are-modules-shown value="false" /> + <flatten-packages value="false" /> + <is-autoscroll-to-source value="true" /> + </todo-panel> + <todo-panel id="all"> + <are-packages-shown value="true" /> + <are-modules-shown value="false" /> + <flatten-packages value="false" /> + <is-autoscroll-to-source value="true" /> + </todo-panel> + <todo-panel id="default-changelist"> + <are-packages-shown value="false" /> + <are-modules-shown value="false" /> + <flatten-packages value="false" /> + <is-autoscroll-to-source value="false" /> + </todo-panel> + </component> <component name="ToolWindowManager"> - <frame x="201" y="66" width="1400" height="1000" extended-state="0" /> + <frame x="88" y="68" width="1594" height="1000" extended-state="0" /> <editor active="true" /> <layout> - <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> - <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" /> - <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" /> - <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> - <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> - <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24962963" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> - <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> - <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> - <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> - <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> - <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> - <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> + <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" /> + <window_info id="Problems" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> + <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> + <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> + <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> + <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> + <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> + <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="true" content_ui="tabs" /> + <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> + <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> + <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" /> + <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32954547" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> + <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> + <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32966322" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> + <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> + <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" /> + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.21826425" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32954547" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> + <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> + <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> + <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.06282383" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> + <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> + <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" /> </layout> </component> <component name="Vcs.Log.UiProperties"> <option name="RECENTLY_FILTERED_USER_GROUPS"> <collection /> </option> + <option name="RECENTLY_FILTERED_BRANCH_GROUPS"> + <collection /> + </option> </component> <component name="VcsContentAnnotationSettings"> <option name="myLimit" value="2678400000" /> @@ -388,12 +419,87 @@ <component name="XDebuggerManager"> <breakpoint-manager /> </component> + <component name="antWorkspaceConfiguration"> + <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" /> + <option name="FILTER_TARGETS" value="false" /> + </component> <component name="editorHistoryManager"> <entry file="file://$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="45" column="2" selection-start="1651" selection-end="1651" vertical-scroll-proportion="-0.8016627" vertical-offset="1080" max-vertical-offset="2670"> + <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2775"> + <caret line="23" column="0" selection-start-line="23" selection-start-column="0" selection-end-line="23" selection-end-column="0" /> + <folding> + <element signature="e#0#19071#0" expanded="true" /> + <element signature="imports" expanded="true" /> + <element signature="e#2675#2676#0" expanded="true" /> + <element signature="e#2727#2728#0" expanded="true" /> + <element signature="e#3607#3608#0" expanded="true" /> + <element signature="e#3669#3670#0" expanded="true" /> + <element signature="e#18552#18568#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/NFSStoragePlugin.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0" vertical-offset="255" max-vertical-offset="6495"> + <caret line="40" column="3" selection-start-line="40" selection-start-column="3" selection-end-line="40" selection-end-column="3" /> + <folding> + <element signature="imports" expanded="true" /> + <element signature="e#12505#12506#0" expanded="true" /> + <element signature="e#12561#12562#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0" vertical-offset="675" max-vertical-offset="2370"> + <caret line="45" column="2" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> + <folding> + <element signature="e#0#19071#0" expanded="true" /> + <element signature="imports" expanded="true" /> + <element signature="e#2675#2676#0" expanded="true" /> + <element signature="e#2727#2728#0" expanded="true" /> + <element signature="e#3607#3608#0" expanded="true" /> + <element signature="e#3669#3670#0" expanded="true" /> + <element signature="e#18552#18568#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="jar:///exlibris/dps/d4_1/system.dir/dps-sdk-4.0.0/lib/dps-sdk-4.0.0.jar!/com/exlibris/core/sdk/storage/handler/AbstractStorageHandler.class"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.14285715" vertical-offset="0" max-vertical-offset="720"> + <caret line="6" column="22" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/NFSStoragePlugin.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="-12.555555" vertical-offset="2586" max-vertical-offset="6885"> + <caret line="195" column="0" selection-start-line="185" selection-start-column="2" selection-end-line="195" selection-end-column="0" /> + <folding> + <element signature="imports" expanded="true" /> + <element signature="e#12505#12506#0" expanded="true" /> + <element signature="e#12561#12562#0" expanded="true" /> + </folding> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.6167883" vertical-offset="6457" max-vertical-offset="7005"> + <caret line="453" column="5" selection-start-line="453" selection-start-column="5" selection-end-line="453" selection-end-column="5" /> <folding> + <element signature="e#0#19071#0" expanded="true" /> <element signature="imports" expanded="true" /> + <element signature="e#2675#2676#0" expanded="true" /> + <element signature="e#2727#2728#0" expanded="true" /> + <element signature="e#3607#3608#0" expanded="true" /> + <element signature="e#3669#3670#0" expanded="true" /> + <element signature="e#18552#18568#0" expanded="true" /> </folding> </state> </provider> @@ -415,6 +521,7 @@ </state> <state key="GlobalLibrariesConfigurable.UI"> <settings> + <last-edited>lib</last-edited> <splitter-proportions> <option name="proportions"> <list> @@ -443,6 +550,7 @@ <option name="proportions"> <list> <option value="0.2" /> + <option value="0.6" /> </list> </option> </splitter-proportions> @@ -462,7 +570,7 @@ </state> <state key="ProjectLibrariesConfigurable.UI"> <settings> - <last-edited>NFSStoragePlugin</last-edited> + <last-edited>dps-sdk-4.0.0</last-edited> <splitter-proportions> <option name="proportions"> <list> diff --git a/Makefile b/Makefile index 8c9fa51..82ffb90 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ SLUBStoragePlugin.jar: $(OBJS) @cp -r PLUGIN-INF/ build/ @cp -r META-INF/ build/ @cd java; find ./ -name "*.class" -print -exec cp --parents -r \{\} $(PWD)/build \; ; cd .. - @cp /exlibris/dps/d4_1/system.dir/bundled_plugins/NFSStoragePlugin.jar build/ + #@cp /exlibris/dps/d4_1/system.dir/bundled_plugins/NFSStoragePlugin.jar build/ #cd build; ${JAVAPATH}/jar xfz /exlibris/dps/d4_1/system.dir/bundled_plugins/NFSStoragePlugin.jar @cd build; ${JAVAPATH}/jar cfvM ../$@ ./* ; cd .. diff --git a/PLUGIN-INF/metadata_SLUBStoragepPlugin.xml b/PLUGIN-INF/metadata_SLUBStoragepPlugin.xml index 0cded4e..0b4f817 100644 --- a/PLUGIN-INF/metadata_SLUBStoragepPlugin.xml +++ b/PLUGIN-INF/metadata_SLUBStoragepPlugin.xml @@ -70,7 +70,7 @@ </fr:x_form> </pl:initParameters> <pl:description>SLUB Storage Plugin</pl:description> - <pl:version>1.2</pl:version> + <pl:version>1.6</pl:version> <pl:materialType>DIGITAL</pl:materialType> <pl:module>Repository</pl:module> <pl:generalType>TASK</pl:generalType> diff --git a/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java b/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java index f945587..8a4a744 100644 --- a/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java +++ b/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java @@ -22,19 +22,20 @@ package org.slub.rosetta.dps.repository.plugin.storage.nfs; import com.exlibris.core.infra.common.exceptions.logging.ExLogger; import com.exlibris.core.infra.common.util.IOUtil; +import com.exlibris.core.infra.svc.api.scriptRunner.ExecExternalProcess; import com.exlibris.core.sdk.storage.containers.StoredEntityMetaData; +import com.exlibris.core.sdk.storage.handler.AbstractStorageHandler; +import com.exlibris.core.sdk.storage.handler.StorageUtil; +import com.exlibris.core.sdk.utils.FileUtil; import com.exlibris.digitool.common.dnx.DnxDocument; import com.exlibris.digitool.common.dnx.DnxSection; import com.exlibris.digitool.common.dnx.DnxSectionRecord; -import com.exlibris.dps.repository.plugin.storage.nfs.NFSStoragePlugin; +import com.exlibris.digitool.common.storage.Fixity; +import com.exlibris.digitool.infrastructure.utils.Checksummer; -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; +import java.io.*; import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.List; +import java.util.*; /** * SLUBStoragePlugin @@ -54,18 +55,303 @@ import java.util.List; * unable to find full documentation. * * @author andreas.romeyke@slub-dresden.de (Andreas Romeyke) - * @see com.exlibris.dps.repository.plugin.storage.nfs.NFSStoragePlugin + * @ see com.exlibris.dps.repository.plugin.storage.nfs.NFSStoragePlugin */ -public class SLUBStoragePlugin extends NFSStoragePlugin { +public class SLUBStoragePlugin extends AbstractStorageHandler { private static final String DIR_ROOT = "DIR_ROOT"; /** {@inheritDoc} */ private static final ExLogger log = ExLogger.getExLogger(SLUBStoragePlugin.class); public SLUBStoragePlugin() { - super(); log.info("SLUBStoragePlugin instantiated"); } - /** prepare right path + public byte[] retrieveEntityByRange(String storedEntityIdentifier, long start, long end) + throws Exception + { + byte[] bytes = new byte[(int)(end - start + 1L)]; + RandomAccessFile file = null; + try + { + file = new RandomAccessFile((String)this.parameters.get("DIR_ROOT") + storedEntityIdentifier, "r"); + file.seek(start); + file.readFully(bytes, 0, (int)(end - start + 1L)); + return bytes; + } + finally + { + if (file != null) { + try + { + file.close(); + } + catch (Exception e) + { + log.warn("Failed closing file", e.getMessage()); + } + } + } + } + + public String getLocalFilePath(String storedEntityIdentifier) + { + return getFullFilePath(storedEntityIdentifier); + } + public String getFullFilePath(String storedEntityIdentifier) + { + return (String)this.parameters.get("DIR_ROOT") + storedEntityIdentifier; + } + public boolean checkFixity(List<Fixity> fixities, String storedEntityIdentifier) + throws Exception + { + return checkFixity(fixities, storedEntityIdentifier, true); + } + public boolean checkFixity(List<Fixity> fixities, String storedEntityIdentifier, boolean isRelativePath) + throws Exception + { + boolean result = true; + if (fixities != null) + { + boolean calcMD5 = false; + boolean calcSHA1 = false; + boolean calcCRC32 = false; + for (Fixity fixity : fixities) + { + fixity.setResult(null); + if (Fixity.FixityAlgorithm.MD5.toString().equals(fixity.getAlgorithm())) + { + calcMD5 = true; + } + else if (Fixity.FixityAlgorithm.SHA1.toString().equals(fixity.getAlgorithm())) + { + calcSHA1 = true; + } + else if (Fixity.FixityAlgorithm.CRC32.toString().equals(fixity.getAlgorithm())) + { + calcCRC32 = true; + } + else + { + String oldValue = fixity.getValue(); + fixity.setValue(getChecksumUsingPlugin(isRelativePath ? getLocalFilePath(storedEntityIdentifier) : storedEntityIdentifier, fixity.getPluginName(), oldValue)); + fixity.setResult(Boolean.valueOf((oldValue == null) || (oldValue.equals(fixity.getValue())))); + result &= fixity.getResult().booleanValue(); + } + } + if ((calcMD5) || (calcSHA1) || (calcCRC32)) + { + InputStream is = null; + try + { + is = retrieveEntity(storedEntityIdentifier, isRelativePath); + Checksummer checksummer = new Checksummer(is, calcMD5, calcSHA1, calcCRC32); + for (Fixity fixity : fixities) + { + int checksummerAlgorithmIndex = getChecksummerAlgorithmIndex(fixity.getAlgorithm()); + if (checksummerAlgorithmIndex != -1) + { + String oldValue = fixity.getValue(); + fixity.setValue(checksummer.getChecksum(fixity.getAlgorithm())); + fixity.setResult(Boolean.valueOf((oldValue == null) || (oldValue.equalsIgnoreCase(fixity.getValue())))); + result &= fixity.getResult().booleanValue(); + } + } + } + finally + { + Checksummer checksummer; + if (is != null) { + is.close(); + } + } + } + } + return result; + } + private int getChecksummerAlgorithmIndex(String algorithm) + { + try + { + Fixity.FixityAlgorithm fixityAlgorithm = Fixity.FixityAlgorithm.valueOf(algorithm); + return fixityAlgorithm.ordinal(); + } + catch (Exception e) {} + return -1; + } + + public boolean deleteEntity(String storedEntityIdentifier) + { + File file = new File((String)this.parameters.get("DIR_ROOT") + storedEntityIdentifier); + try + { + return file.delete(); + } + catch (Exception e) + { + log.warn("failed to delete entity with path: " + file.getPath(), e.getMessage()); + } + return true; + } + public InputStream retrieveEntity(String storedEntityIdentifier) + throws IOException + { + return retrieveEntity(storedEntityIdentifier, true); + } + public InputStream retrieveEntity(String storedEntityIdentifier, boolean isRelative) + throws IOException + { + return new FileInputStream((isRelative ? (String)this.parameters.get("DIR_ROOT") : "") + storedEntityIdentifier); + } + public String storeEntity(InputStream is, StoredEntityMetaData storedEntityMetadata) + throws Exception + { + String existsDescPath = getFilePathInDescIfExists(storedEntityMetadata); + + String destFilePath = null; + + boolean isCopyFileNeeded = true; + if (existsDescPath != null) + { + destFilePath = existsDescPath; + isCopyFileNeeded = !checkFixity(storedEntityMetadata.getFixities(), destFilePath, false); + } + Map<String, String> paths = getStoreEntityIdentifier(storedEntityMetadata, destFilePath); + String storedEntityIdentifier = (String)paths.get("relativeDirectoryPath"); + destFilePath = (String)paths.get("destFilePath"); + if (isCopyFileNeeded) + { + if (canHandleSourcePath(storedEntityMetadata.getCurrentFilePath())) + { + if (is != null) { + is.close(); + } + copyStream(storedEntityMetadata, destFilePath); + } + else + { + log.info("Cannot handle source path: " + storedEntityMetadata.getCurrentFilePath()); + if (is == null) + { + log.warn("InputStream is null"); + return null; + } + FileOutputStream output = null; + try + { + output = new FileOutputStream(new File(destFilePath)); + IOUtil.copy(is, output); + } + finally + { + IOUtil.closeQuietly(output); + } + } + if (!checkFixity(storedEntityMetadata.getFixities(), storedEntityIdentifier)) { + return null; + } + } + return storedEntityIdentifier; + } + protected void copyStream(StoredEntityMetaData storedEntityMetadata, String destPath) + throws IOException + { + String filesHandlingMethod = (String)this.parameters.get("FILES_HANDLING_METHOD"); + String srcPath = storedEntityMetadata.getCurrentFilePath(); + + String pid = storedEntityMetadata.getEntityPid(); + String iePid = storedEntityMetadata.getIePid(); + if ("move".equalsIgnoreCase(filesHandlingMethod)) + { + File canonicalSrcFile = getCanonicalFile(srcPath); + FileUtil.moveFile(canonicalSrcFile, new File(destPath)); + saveDestPathsTmpFile(iePid, pid, destPath); + } + else if ("soft_link".equalsIgnoreCase(filesHandlingMethod)) + { + softLink(srcPath, destPath); + } + else if ("hard_link".equalsIgnoreCase(filesHandlingMethod)) + { + hardLink(srcPath, destPath); + } + else + { + FileUtil.copyFile(srcPath, destPath); + saveDestPathsTmpFile(iePid, pid, destPath); + } + } + private void saveDestPathsTmpFile(String folder, String key, String path) + { + if (folder == null) { + return; + } + String tmpFilePath = getTempStorageDirectory(false) + "destPath"; + + + File destPathDir = new File(getTempStorageDirectory(false) + "destPath" + File.separator); + if (!destPathDir.exists()) { + destPathDir.mkdirs(); + } + StorageUtil.saveDestPathToTmpFile(folder, tmpFilePath, key, path); + } + private File getCanonicalFile(String srcPath) + { + String fileName = srcPath.split("\\" + File.separator)[(srcPath.split("\\" + File.separator).length - 1)]; + File canonicalSrcDir = null; + try + { + canonicalSrcDir = new File(srcPath).getParentFile().getCanonicalFile(); + return new File(canonicalSrcDir, fileName).getCanonicalFile(); + } + catch (IOException e) { + log.warn("getCanonicalFile of '" + srcPath + "':" + e.getMessage()); + } + return null; + } + + private void hardLink(String srcPath, String destPath) + throws IOException + { + String command = "ln"; + ExecExternalProcess proc = new ExecExternalProcess(); + List<String> args = new LinkedList(); + args.add(srcPath); + args.add(destPath); + int retValue = proc.execExternalProcess(command, args); + if (retValue != 0) { + throw new IOException("ln " + srcPath + " " + destPath + " failed " + proc.getErrorStream() + proc.getInputStream()); + } + } + + private void softLink(String srcPath, String destPath) + throws IOException + { + File source = new File(srcPath); + if (!source.exists()) { + throw new IOException("File " + source + " does not exist"); + } + String command = "ln"; + ExecExternalProcess proc = new ExecExternalProcess(); + List<String> args = new ArrayList(); + args.add("-s"); + args.add(srcPath); + args.add(destPath); + int retValue = proc.execExternalProcess(command, args); + if (retValue != 0) { + throw new IOException("ln -s " + srcPath + " " + destPath + " failed " + proc.getErrorStream() + proc.getInputStream()); + } + } + + protected String getFilePathInDescIfExists(StoredEntityMetaData storedEntityMetadata) + { + String tmpFilePath = getTempStorageDirectory(false) + "destPath"; + if (storedEntityMetadata.getIePid() == null) { + return null; + } + String existsDescPath = StorageUtil.readDestPathFromTmpFile(storedEntityMetadata.getIePid(), tmpFilePath, storedEntityMetadata.getEntityPid()); + return existsDescPath; + } + + /** prepare right path * path should be of form yyyy/MM/dd/IE-PID/ * we need to findout the associated dnx document (IE), * get the creation date of the IE/SIP @@ -74,7 +360,7 @@ public class SLUBStoragePlugin extends NFSStoragePlugin { * @return calculated relative path as String * returns the path as string */ - protected String getStreamRelativePath(StoredEntityMetaData storedEntityMetaData ) throws Exception { + private String getStreamRelativePath(StoredEntityMetaData storedEntityMetaData ) throws Exception { log.info("SLUBStoragePlugin AAB"); String relativeDirectoryPath = File.separator; // get IE PID by calling IE-DNX record and search for ""internalIdentifierType" == "PID" @@ -126,7 +412,7 @@ public class SLUBStoragePlugin extends NFSStoragePlugin { /** copied from NFS Storage Plugin, enhanced with debugging info, * this combines full file path and creates parent directories if needed {@inheritDoc} */ - protected File getStreamDirectory(String path, String fileName) { + private File getStreamDirectory(String path, String fileName) { File newDir = new File(parameters.get(DIR_ROOT) + File.separator + path); log.info("SLUBStoragePlugin.getStreamDirectory path=" + path); log.info("SLUBStoragePlugin.getStreamDirectory fileName=" + fileName); @@ -148,4 +434,28 @@ public class SLUBStoragePlugin extends NFSStoragePlugin { return false; } } +private String getNextDir(String fullPath) + { + String[] dirs = fullPath.split("\\" + File.separator); + return dirs[(dirs.length - 2)]; + } + +private Map<String, String> getStoreEntityIdentifier(StoredEntityMetaData storedEntityMetadata, String destFilePath) throws Exception + { + Map<String, String> paths = new HashMap<String, String>(); + + String fileName = createFileName(storedEntityMetadata); + + String relativeDirectoryPath = getStreamRelativePath(storedEntityMetadata); + if (destFilePath == null) + { + File destFile = getStreamDirectory(relativeDirectoryPath, fileName); + destFilePath = destFile.getAbsolutePath(); + } + paths.put("destFilePath", destFilePath); + paths.put("relativeDirectoryPath", (relativeDirectoryPath + getNextDir(destFilePath) + File.separator + fileName)); + return paths; + + } + } -- GitLab