[jboss-svn-commits] JBoss Common SVN: r4611 - shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/exporter.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Jun 29 13:39:11 EDT 2010
Author: ALRubinger
Date: 2010-06-29 13:39:10 -0400 (Tue, 29 Jun 2010)
New Revision: 4611
Added:
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/exporter/StreamExporter.java
Log:
[SHRINKWRAP-199] ArchiveAsset to know which exporter to use to fulfill the Asset.openStream contract
Added: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/exporter/StreamExporter.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/exporter/StreamExporter.java (rev 0)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/exporter/StreamExporter.java 2010-06-29 17:39:10 UTC (rev 4611)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.shrinkwrap.api.exporter;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.jboss.shrinkwrap.api.Assignable;
+
+/**
+ * Generic exporter capable of representing an {@link Assignable}
+ * as an {@link InputStream}, or writing its contents to
+ * a provided {@link OutputStream}.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface StreamExporter extends Assignable
+{
+ //-------------------------------------------------------------------------------------||
+ // Contracts --------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Exports this reference in an implementation-specific
+ * format represented by the returned {@link InputStream}
+ *
+ * @return {@link InputStream} to read the exported view
+ */
+ InputStream export();
+
+ /**
+ * Exports provided archive in an implementation-specific format,
+ * written to the specified {@link OutputStream} target. The specified
+ * target will be closed upon completion.
+ *
+ * @param target
+ * @throws ArchiveExportException
+ * @throws IllegalArgumentException If the target is not specified or is closed
+ */
+ void export(OutputStream target) throws ArchiveExportException, IllegalArgumentException;
+}
More information about the jboss-svn-commits
mailing list