com.google.appengine.api.conversion.dev
Class LocalConversionService

java.lang.Object
  extended by AbstractLocalRpcService
      extended by com.google.appengine.api.conversion.dev.LocalConversionService

@ServiceProvider(value=)
public final class LocalConversionService
extends AbstractLocalRpcService

A stub for the ConversionService API for offline development. Since there's no obvious way to simulate the conversion service, we bundle "canonical" files under the static subdirectory for each target conversion type and return them all the time regardless of the input. For each conversion, we only return one asset here.


Field Summary
static  CONVERTED_FILES_STUB
          Names of "canonical" files for each target conversion type.
static java.lang.String PACKAGE
          The package name of this service.
 
Constructor Summary
LocalConversionService()
           
 
Method Summary
 ConversionResponse convert(Status status, ConversionRequest request)
           
 java.lang.String getPackage()
          
 void init(LocalServiceContext context, java.util.Map<java.lang.String,java.lang.String> properties)
          
static byte[] readStubFile(java.lang.String outputMimeType)
          Read the data out of the stub file for the specified output mime type.
 void start()
          
 void stop()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONVERTED_FILES_STUB

public static final  CONVERTED_FILES_STUB
Names of "canonical" files for each target conversion type.


PACKAGE

public static final java.lang.String PACKAGE
The package name of this service.

See Also:
Constant Field Values
Constructor Detail

LocalConversionService

public LocalConversionService()
Method Detail

getPackage

public java.lang.String getPackage()


init

public void init(LocalServiceContext context,
                 java.util.Map<java.lang.String,java.lang.String> properties)


start

public void start()


stop

public void stop()


readStubFile

public static byte[] readStubFile(java.lang.String outputMimeType)
                           throws com.google.apphosting.api.ApiProxy.ApplicationException,
                                  java.io.IOException
Read the data out of the stub file for the specified output mime type.

Parameters:
outputMimeType - The output mime type.
Returns:
The data read from the stub file.
Throws:
ApiProxy.ApplicationException - if failed to read the data out of the stub file.
java.io.IOException - if failed to close the InputStream to read stub file.

convert

public ConversionResponse convert(Status status,
                                  ConversionRequest request)
                           throws java.io.IOException
Throws:
java.io.IOException