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
25a783a8
Commit
25a783a8
authored
4 years ago
by
Grégory Mantelet
Browse files
Options
Downloads
Patches
Plain Diff
[TAP] Fix intermixed VOTable documents in synchronous mode.
Fix #52
parent
30dc11cb
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/tap/formatter/FITSFormat.java
+37
-20
37 additions, 20 deletions
src/tap/formatter/FITSFormat.java
src/tap/formatter/VOTableFormat.java
+268
-155
268 additions, 155 deletions
src/tap/formatter/VOTableFormat.java
with
305 additions
and
175 deletions
src/tap/formatter/FITSFormat.java
+
37
−
20
View file @
25a783a8
...
...
@@ -16,7 +16,8 @@ package tap.formatter;
* 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 2014-2015 - Astronomisches Rechen Institut (ARI)
* Copyright 2014-2020 - UDS/Centre de Données astronomiques de Strasbourg (CDS)
* Astronomisches Rechen Institut (ARI)
*/
import
java.io.IOException
;
...
...
@@ -35,21 +36,24 @@ import uk.ac.starlink.table.StoragePolicy;
/**
* Format any given query (table) result into FITS.
*
* @author Grégory Mantelet (ARI)
* @version 2.
1
(
11
/20
15
)
* @author Grégory Mantelet (
CDS;
ARI)
* @version 2.
4
(
08
/20
20
)
* @since 2.0
*/
public
class
FITSFormat
implements
OutputFormat
{
/** The {@link ServiceConnection} to use (for the log and to have some information about the service (particularly: name, description). */
/** The {@link ServiceConnection} to use (for the log and to have some
* information about the service (particularly: name, description). */
protected
final
ServiceConnection
service
;
/**
* Creates a FITS formatter.
*
* @param service The service to use (for the log and to have some information about the service (particularly: name, description).
* @param service The service to use (for the log and to have some
* information about the service (particularly: name,
* description).
*
* @throws NullPointerException If the given service connection is
<code>null</code>
.
* @throws NullPointerException If the given service connection is
NULL
.
*/
public
FITSFormat
(
final
ServiceConnection
service
)
throws
NullPointerException
{
if
(
service
==
null
)
...
...
@@ -87,7 +91,20 @@ public class FITSFormat implements OutputFormat {
LimitedStarTable
table
=
new
LimitedStarTable
(
result
,
colInfos
,
execReport
.
parameters
.
getMaxRec
(),
thread
);
// Copy the table on disk (or in memory if the table is short):
StarTable
copyTable
=
StoragePolicy
.
PREFER_DISK
.
copyTable
(
table
);
StarTable
copyTable
;
try
{
copyTable
=
StoragePolicy
.
PREFER_DISK
.
copyTable
(
table
);
}
catch
(
IOException
ioe
)
{
/* In case of time out, LimitedStarTable makes copyTable to stop by
* throwing an IOException. In such case, this IOException has to be
* interpreted as a normal interruption: */
if
(
thread
.
isInterrupted
())
throw
new
InterruptedException
();
/* Otherwise, the error has to be managed properly (so, wrap it
* inside a TAPException): */
else
throw
new
TAPException
(
"Unexpected error while formatting the result!"
,
ioe
);
}
if
(
thread
.
isInterrupted
())
throw
new
InterruptedException
();
...
...
This diff is collapsed.
Click to expand it.
src/tap/formatter/VOTableFormat.java
+
268
−
155
View file @
25a783a8
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