Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
ee1cab36
Commit
ee1cab36
authored
14 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
LMS-1506 new factory method
SVN: 15762
parent
555c0f08
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/source/java/ch/systemsx/cisd/common/highwatermark/HostAwareFileWithHighwaterMark.java
+16
-3
16 additions, 3 deletions
.../common/highwatermark/HostAwareFileWithHighwaterMark.java
with
16 additions
and
3 deletions
common/source/java/ch/systemsx/cisd/common/highwatermark/HostAwareFileWithHighwaterMark.java
+
16
−
3
View file @
ee1cab36
...
...
@@ -114,6 +114,22 @@ public final class HostAwareFileWithHighwaterMark extends HostAwareFile
assert
properties
!=
null
:
"Unspecified properties"
;
assert
StringUtils
.
isNotBlank
(
hostFilePropertyKey
)
:
"Host-file property key is blank"
;
final
String
hostFile
=
PropertyUtils
.
getMandatoryProperty
(
properties
,
hostFilePropertyKey
);
final
long
highwaterMarkInKb
=
PropertyUtils
.
getLong
(
properties
,
hostFilePropertyKey
.
concat
(
SEP
).
concat
(
HIGHWATER_MARK_PROPERTY_KEY
),
-
1L
);
return
create
(
hostFile
,
highwaterMarkInKb
);
}
/**
* Instantiates a new <code>FileWithHighwaterMark</code> from specified host file and
* high-water mark.
*
* @param hostFile Either a local file or remote file in SSH notation (i.e. <host>:<path>).
* @param highwaterMarkInKb -1 means no checking for high water.
*/
public
static
HostAwareFileWithHighwaterMark
create
(
final
String
hostFile
,
final
long
highwaterMarkInKb
)
{
File
file
;
String
hostNameOrNull
=
null
;
final
int
index
=
hostFile
.
indexOf
(
HOST_FILE_SEP
);
...
...
@@ -136,9 +152,6 @@ public final class HostAwareFileWithHighwaterMark extends HostAwareFile
rsyncModuleOrNull
=
null
;
file
=
getCanonicalFile
(
hostFile
);
}
final
long
highwaterMarkInKb
=
PropertyUtils
.
getLong
(
properties
,
hostFilePropertyKey
.
concat
(
SEP
).
concat
(
HIGHWATER_MARK_PROPERTY_KEY
),
-
1L
);
return
new
HostAwareFileWithHighwaterMark
(
hostNameOrNull
,
file
,
rsyncModuleOrNull
,
highwaterMarkInKb
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment