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
2cabadec
Commit
2cabadec
authored
14 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
MINOR: Be more robust in handling user input.
SVN: 16556
parent
1477868b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
datastore_server/source/java/ch/systemsx/cisd/openbis/dss/client/api/cli/CommandPut.java
+17
-6
17 additions, 6 deletions
.../systemsx/cisd/openbis/dss/client/api/cli/CommandPut.java
with
17 additions
and
6 deletions
datastore_server/source/java/ch/systemsx/cisd/openbis/dss/client/api/cli/CommandPut.java
+
17
−
6
View file @
2cabadec
...
...
@@ -116,7 +116,8 @@ class CommandPut extends AbstractCommand
getProperties
();
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"\nProprties must be specified using as code=value[,code=value]*\n"
);
System
.
err
.
println
(
"\nProprties must be specified using as code=value[,code=value]*\n"
);
return
false
;
}
...
...
@@ -156,8 +157,7 @@ class CommandPut extends AbstractCommand
}
return
-
1
;
}
IDataSetDss
dataSet
=
component
.
putDataSet
(
newDataSet
,
new
File
(
arguments
.
getFilePath
()));
IDataSetDss
dataSet
=
component
.
putDataSet
(
newDataSet
,
arguments
.
getFile
());
System
.
out
.
println
(
"Registered new data set "
+
dataSet
.
getCode
());
}
catch
(
IOException
e
)
{
...
...
@@ -178,11 +178,15 @@ class CommandPut extends AbstractCommand
// Get the file infos
String
filePath
=
arguments
.
getFilePath
();
File
file
=
new
File
(
filePath
);
File
file
=
arguments
.
getFile
(
);
ArrayList
<
FileInfoDssDTO
>
fileInfos
=
getFileInfosForPath
(
filePath
,
file
);
// Get the parent
String
parentNameOrNull
=
(
file
.
isDirectory
())
?
file
.
getName
()
:
null
;
String
parentNameOrNull
=
null
;
if
(
file
.
isDirectory
())
{
parentNameOrNull
=
file
.
getName
();
}
NewDataSetDTO
dataSet
=
new
NewDataSetDTO
(
owner
,
parentNameOrNull
,
fileInfos
);
// Set the data set type (may be null)
...
...
@@ -206,7 +210,14 @@ class CommandPut extends AbstractCommand
{
return
fileInfos
;
}
FileInfoDssBuilder
builder
=
new
FileInfoDssBuilder
(
path
,
path
);
// Strip terminal separators for the file info builder
String
pathToUse
=
path
;
String
separator
=
""
+
File
.
separatorChar
;
if
(
pathToUse
.
endsWith
(
separator
))
{
pathToUse
=
pathToUse
.
substring
(
0
,
pathToUse
.
length
()
-
1
);
}
FileInfoDssBuilder
builder
=
new
FileInfoDssBuilder
(
pathToUse
,
pathToUse
);
builder
.
appendFileInfosForFile
(
file
,
fileInfos
,
true
);
return
fileInfos
;
}
...
...
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