org.zanata.client.commands.pull
Class GettextPullStrategy

java.lang.Object
  extended by org.zanata.client.commands.pull.AbstractPullStrategy
      extended by org.zanata.client.commands.pull.AbstractGettextPullStrategy
          extended by org.zanata.client.commands.pull.GettextPullStrategy
All Implemented Interfaces:
PullStrategy

public class GettextPullStrategy
extends AbstractGettextPullStrategy

Author:
Sean Flanigan sflaniga@redhat.com

Constructor Summary
GettextPullStrategy(PullOptions opts)
           
 
Method Summary
 File getTransFileToWrite(String docName, LocaleMapping localeMapping)
          Provides the file reference that will be used to write a Translation file for a given Resource.
 org.zanata.common.io.FileDetails writeTransFile(org.zanata.rest.dto.resource.Resource doc, String docName, LocaleMapping locMapping, org.zanata.rest.dto.resource.TranslationsResource targetDoc)
          pre: docWithLocalName.getName() must match docName if docWithLocalName is not null
 
Methods inherited from class org.zanata.client.commands.pull.AbstractGettextPullStrategy
getExtensions, getPoWriter, needsDocToWriteTrans, writeSrcFile
 
Methods inherited from class org.zanata.client.commands.pull.AbstractPullStrategy
getOpts, isTransOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GettextPullStrategy

public GettextPullStrategy(PullOptions opts)
Method Detail

getTransFileToWrite

public File getTransFileToWrite(String docName,
                                LocaleMapping localeMapping)
Description copied from interface: PullStrategy
Provides the file reference that will be used to write a Translation file for a given Resource. Ideally, this method should be used by concrete implementations of the strategy to write the file.

Parameters:
docName - may be null if needsDocToWriteTrans() returns false
localeMapping - Locale mapping to use.
Returns:
A File reference (might not exist physically) to which a Translation Resource will be written.

writeTransFile

public org.zanata.common.io.FileDetails writeTransFile(org.zanata.rest.dto.resource.Resource doc,
                                                       String docName,
                                                       LocaleMapping locMapping,
                                                       org.zanata.rest.dto.resource.TranslationsResource targetDoc)
                                                throws IOException
Description copied from interface: PullStrategy
pre: docWithLocalName.getName() must match docName if docWithLocalName is not null

Parameters:
doc - may be null if needsDocToWriteTrans() returns false
docName - may be null if needsDocToWriteTrans() returns false
Returns:
Details of the file that was written. May be null if the Strategy cannot provide details.
Throws:
IOException


Copyright © 2013 Zanata Project. All Rights Reserved.