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
30b1b207
Commit
30b1b207
authored
7 years ago
by
Fuentes Serna Juan Mariano (ID SIS)
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://sissource.ethz.ch/sispub/openbis
parents
2c90d409
61ce562e
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
datastore_server/source/java/ch/systemsx/cisd/etlserver/api/v1/PutDataSetService.java
+27
-40
27 additions, 40 deletions
.../ch/systemsx/cisd/etlserver/api/v1/PutDataSetService.java
with
27 additions
and
40 deletions
datastore_server/source/java/ch/systemsx/cisd/etlserver/api/v1/PutDataSetService.java
+
27
−
40
View file @
30b1b207
...
@@ -274,26 +274,12 @@ public class PutDataSetService implements IPutDataSetService
...
@@ -274,26 +274,12 @@ public class PutDataSetService implements IPutDataSetService
doInitialization
();
doInitialization
();
}
}
if
(
StringUtils
.
isBlank
(
sessionToken
))
validateSessionToken
(
sessionToken
);
{
validateUploadId
(
uploadId
);
throw
new
UserFailureException
(
"Session token cannot be null or empty"
);
}
if
(
sessionToken
.
contains
(
"/"
))
{
throw
new
UserFailureException
(
"Session token must not contain '/'"
);
}
if
(
newDataSet
==
null
)
if
(
newDataSet
==
null
)
{
{
throw
new
UserFailureException
(
"New data set cannot be null"
);
throw
new
UserFailureException
(
"New data set cannot be null"
);
}
}
if
(
StringUtils
.
isBlank
(
uploadId
))
{
throw
new
UserFailureException
(
"Upload id cannot be null or empty"
);
}
if
(
uploadId
.
contains
(
"/"
))
{
throw
new
UserFailureException
(
"Upload id must not contain '/'"
);
}
ServiceProvider
.
getOpenBISService
().
checkSession
(
sessionToken
);
ServiceProvider
.
getOpenBISService
().
checkSession
(
sessionToken
);
...
@@ -346,14 +332,8 @@ public class PutDataSetService implements IPutDataSetService
...
@@ -346,14 +332,8 @@ public class PutDataSetService implements IPutDataSetService
try
try
{
{
if
(
StringUtils
.
isBlank
(
sessionToken
))
validateSessionToken
(
sessionToken
);
{
validateUploadId
(
uploadId
);
throw
new
UserFailureException
(
"Session token cannot be null or empty"
);
}
if
(
sessionToken
.
contains
(
"/"
))
{
throw
new
UserFailureException
(
"Session token must not contain '/'"
);
}
if
(
StringUtils
.
isBlank
(
filePath
))
if
(
StringUtils
.
isBlank
(
filePath
))
{
{
throw
new
UserFailureException
(
"File path cannot be null or empty"
);
throw
new
UserFailureException
(
"File path cannot be null or empty"
);
...
@@ -370,14 +350,6 @@ public class PutDataSetService implements IPutDataSetService
...
@@ -370,14 +350,6 @@ public class PutDataSetService implements IPutDataSetService
{
{
throw
new
UserFailureException
(
"Data set type cannot be null or empty"
);
throw
new
UserFailureException
(
"Data set type cannot be null or empty"
);
}
}
if
(
StringUtils
.
isBlank
(
uploadId
))
{
throw
new
UserFailureException
(
"Upload id cannot be null or empty"
);
}
if
(
uploadId
.
contains
(
"/"
))
{
throw
new
UserFailureException
(
"Upload id must not contain '/'"
);
}
if
(
inputStream
==
null
)
if
(
inputStream
==
null
)
{
{
throw
new
UserFailureException
(
"Input stream cannot be null"
);
throw
new
UserFailureException
(
"Input stream cannot be null"
);
...
@@ -613,14 +585,7 @@ public class PutDataSetService implements IPutDataSetService
...
@@ -613,14 +585,7 @@ public class PutDataSetService implements IPutDataSetService
doInitialization
();
doInitialization
();
}
}
if
(
StringUtils
.
isBlank
(
sessionToken
))
validateSessionToken
(
sessionToken
);
{
throw
new
IllegalArgumentException
(
"Session token cannot be null or empty"
);
}
if
(
sessionToken
.
contains
(
"/"
))
{
throw
new
UserFailureException
(
"Session token must not contain '/'"
);
}
Collection
<
TopLevelDataSetRegistratorGlobalState
>
states
=
getThreadGlobalStates
();
Collection
<
TopLevelDataSetRegistratorGlobalState
>
states
=
getThreadGlobalStates
();
...
@@ -646,6 +611,28 @@ public class PutDataSetService implements IPutDataSetService
...
@@ -646,6 +611,28 @@ public class PutDataSetService implements IPutDataSetService
}
}
}
}
private
void
validateSessionToken
(
String
sessionToken
)
{
validate
(
sessionToken
,
"Session token"
);
}
private
void
validateUploadId
(
String
uploadId
)
{
validate
(
uploadId
,
"Upload id"
);
}
private
void
validate
(
String
uploadId
,
String
name
)
{
if
(
StringUtils
.
isBlank
(
uploadId
))
{
throw
new
UserFailureException
(
name
+
" cannot be null or empty"
);
}
if
(
uploadId
.
contains
(
"/"
))
{
throw
new
UserFailureException
(
name
+
" must not contain '/'"
);
}
}
}
}
/**
/**
...
...
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