[Mulgara-svn] r1506 - trunk/src/jar/resolver/java/org/mulgara/resolver
ronald at mulgara.org
ronald at mulgara.org
Tue Feb 17 10:38:05 UTC 2009
Author: ronald
Date: 2009-02-17 02:38:04 -0800 (Tue, 17 Feb 2009)
New Revision: 1506
Modified:
trunk/src/jar/resolver/java/org/mulgara/resolver/ExportOperation.java
trunk/src/jar/resolver/java/org/mulgara/resolver/OutputOperation.java
Log:
Trivial source formatting fix: removed trailing spaces.
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/ExportOperation.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/ExportOperation.java 2009-02-17 10:37:59 UTC (rev 1505)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/ExportOperation.java 2009-02-17 10:38:04 UTC (rev 1506)
@@ -34,21 +34,21 @@
/**
* An {@link Operation} that serializes the contents of an RDF graph to either
* an output stream or a destination file.
- *
+ *
* @created Jun 25, 2008
* @author Alex Hall
* @copyright © 2008 <a href="http://www.revelytix.com">Revelytix, Inc.</a>
* @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
*/
class ExportOperation extends OutputOperation {
-
+
private final URI graphURI;
private final Map<String,URI> prefixes;
-
+
/**
* Create an {@link Operation} which exports the contents of the specified RDF graph
* to a URI or to an output stream.
- *
+ *
* The database is not changed by this method.
* If an {@link OutputStream} is supplied then the destinationURI is ignored.
*
@@ -63,7 +63,7 @@
public ExportOperation(OutputStream outputStream, URI graphURI, URI destinationURI,
Map<String,URI> initialPrefixes) {
super(outputStream, destinationURI);
-
+
if (graphURI == null) {
throw new IllegalArgumentException("Graph URI may not be null.");
}
@@ -75,20 +75,20 @@
* @see org.mulgara.resolver.OutputOperation#execute(org.mulgara.resolver.OperationContext, org.mulgara.resolver.spi.SystemResolver, org.mulgara.resolver.spi.DatabaseMetadata)
*/
@Override
- public void execute(OperationContext operationContext, SystemResolver systemResolver,
+ public void execute(OperationContext operationContext, SystemResolver systemResolver,
DatabaseMetadata metadata) throws Exception {
// Verify that the graph is of a type that supports exports.
long graph = systemResolver.localize(new URIReferenceImpl(graphURI));
ResolverFactory resolverFactory = operationContext.findModelResolverFactory(graph);
-
- if (resolverFactory.supportsExport()) {
+
+ if (resolverFactory.supportsExport()) {
OutputStream os = getOutputStream();
assert os != null;
OutputStreamWriter writer = null;
-
+
try {
writer = new OutputStreamWriter(os, "UTF-8");
-
+
// create a constraint to get all statements
Variable[] vars = new Variable[] {
StatementStore.VARIABLES[0],
@@ -96,11 +96,11 @@
StatementStore.VARIABLES[2]
};
Constraint constraint = new ConstraintImpl(vars[0], vars[1], vars[2], new LocalNode(graph));
-
+
// Get all statements from the graph. Delegate to the operation context to do the security check.
Tuples resolution = operationContext.resolve(constraint);
Statements graphStatements = new TuplesWrapperStatements(resolution, vars[0], vars[1], vars[2]);
-
+
// Do the writing.
try {
// TODO: Use the destination URI file suffix to determine the appropriate writer.
@@ -125,5 +125,4 @@
throw new QueryException("Graph " + graphURI + " does not support export.");
}
}
-
}
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/OutputOperation.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/OutputOperation.java 2009-02-17 10:37:59 UTC (rev 1505)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/OutputOperation.java 2009-02-17 10:38:04 UTC (rev 1506)
@@ -28,7 +28,7 @@
* @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
*/
public abstract class OutputOperation extends TuplesBasedOperation implements Operation {
-
+
protected final OutputStream outputStream;
protected final URI destinationURI;
@@ -39,7 +39,7 @@
this.outputStream = outputStream;
this.destinationURI = destinationURI;
}
-
+
/**
* Gets an output stream for this operation, opening one from the destination
* URI if necessary.
@@ -48,7 +48,7 @@
*/
protected OutputStream getOutputStream() throws FileNotFoundException {
OutputStream os = outputStream;
-
+
// Check if an output stream was supplied and open the local file if it
// hasn't.
if (os == null) {
@@ -69,10 +69,10 @@
// Ensure the output is buffered for efficiency.
os = new BufferedOutputStream(os);
-
+
return os;
}
-
+
/* (non-Javadoc)
* @see org.mulgara.resolver.Operation#execute(org.mulgara.resolver.OperationContext, org.mulgara.resolver.spi.SystemResolver, org.mulgara.resolver.spi.DatabaseMetadata)
*/
@@ -86,5 +86,4 @@
public boolean isWriteOperation() {
return false;
}
-
}
More information about the Mulgara-svn
mailing list