Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vollt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sonia Zorba
vollt
Commits
65b4a8a0
Commit
65b4a8a0
authored
10 years ago
by
gmantele
Browse files
Options
Downloads
Patches
Plain Diff
TAP: Ensure that no upload is done if this feature is disabled, by throwing a TAPException
parent
e81dc51a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tap/upload/Uploader.java
+19
-20
19 additions, 20 deletions
src/tap/upload/Uploader.java
with
19 additions
and
20 deletions
src/tap/upload/Uploader.java
+
19
−
20
View file @
65b4a8a0
...
...
@@ -16,14 +16,22 @@ package tap.upload;
* You should have received a copy of the GNU Lesser General Public License
* along with TAPLibrary. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2012 - UDS/Centre de Données astronomiques de Strasbourg (CDS)
* Copyright 2012-2014 - UDS/Centre de Données astronomiques de Strasbourg (CDS),
* Astronomisches Rechen Institute (ARI)
*/
import
java.io.IOException
;
import
java.io.InputStream
;
import
com.oreilly.servlet.multipart.ExceededSizeException
;
import
tap.ServiceConnection
;
import
tap.ServiceConnection.LimitUnit
;
import
tap.TAPException
;
import
tap.db.DBConnection
;
import
tap.db.DBException
;
import
tap.metadata.TAPSchema
;
import
tap.metadata.TAPTable
;
import
tap.metadata.TAPTypes
;
import
tap.metadata.VotType
;
import
cds.savot.model.DataBinaryReader
;
import
cds.savot.model.FieldSet
;
import
cds.savot.model.SavotBinary
;
...
...
@@ -32,21 +40,16 @@ import cds.savot.model.SavotResource;
import
cds.savot.model.SavotTR
;
import
cds.savot.model.SavotTableData
;
import
cds.savot.model.TRSet
;
import
cds.savot.pull.SavotPullEngine
;
import
cds.savot.pull.SavotPullParser
;
import
tap.ServiceConnection
;
import
tap.TAPException
;
import
tap.ServiceConnection.LimitUnit
;
import
tap.db.DBConnection
;
import
tap.db.DBException
;
import
tap.metadata.TAPSchema
;
import
tap.metadata.TAPTable
;
import
tap.metadata.TAPTypes
;
import
tap.metadata.VotType
;
import
com.oreilly.servlet.multipart.ExceededSizeException
;
/**
*
* @author Grégory Mantelet (CDS;ARI) - gmantele@ari.uni-heidelberg.de
* @version 1.1 (03/2014)
*/
public
class
Uploader
{
protected
final
ServiceConnection
<?>
service
;
...
...
@@ -65,8 +68,6 @@ public class Uploader {
this
.
service
=
service
;
this
.
dbConn
=
dbConn
;
if
(
dbConn
==
null
)
throw
new
NullPointerException
(
"The given DBConnection is NULL !"
);
if
(
service
.
uploadEnabled
()){
if
(
service
.
getUploadLimitType
()[
1
]
==
LimitUnit
.
rows
){
...
...
@@ -76,10 +77,8 @@ public class Uploader {
nbBytesLimit
=
((
service
.
getUploadLimit
()[
1
]
>
0
)
?
service
.
getUploadLimit
()[
1
]
:
-
1
);
nbRowsLimit
=
-
1
;
}
}
else
{
nbRowsLimit
=
-
1
;
nbBytesLimit
=
-
1
;
}
}
else
throw
new
TAPException
(
"Upload aborted: this functionality is disabled in this TAP service!"
);
}
public
TAPSchema
upload
(
final
TableLoader
[]
loaders
)
throws
TAPException
{
...
...
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