当前位置: 首页>>代码示例>>Java>>正文


Java ContentReader.setLocale方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.repository.ContentReader.setLocale方法的典型用法代码示例。如果您正苦于以下问题:Java ContentReader.setLocale方法的具体用法?Java ContentReader.setLocale怎么用?Java ContentReader.setLocale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.repository.ContentReader的用法示例。


在下文中一共展示了ContentReader.setLocale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getReader

import org.alfresco.service.cmr.repository.ContentReader; //导入方法依赖的package包/类
/**
 * Performs checks and copies required reader attributes
 */
public final ContentReader getReader() throws ContentIOException
{
    String contentUrl = getContentUrl();
    if (!isClosed())
    {
        return new EmptyContentReader(contentUrl);
    }
    ContentReader reader = createReader();
    if (reader == null)
    {
        throw new AlfrescoRuntimeException("ContentReader failed to create new reader: \n" +
                "   writer: " + this);
    }
    else if (reader.getContentUrl() == null || !reader.getContentUrl().equals(contentUrl))
    {
        throw new AlfrescoRuntimeException("ContentReader has different URL: \n" +
                "   writer: " + this + "\n" +
                "   new reader: " + reader);
    }
    // copy across common attributes
    reader.setMimetype(this.getMimetype());
    reader.setEncoding(this.getEncoding());
    reader.setLocale(this.getLocale());
    // done
    if (logger.isDebugEnabled())
    {
        logger.debug("Writer spawned new reader: \n" +
                "   writer: " + this + "\n" +
                "   new reader: " + reader);
    }
    return reader;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:36,代码来源:AbstractContentWriter.java

示例2: getReader

import org.alfresco.service.cmr.repository.ContentReader; //导入方法依赖的package包/类
/**
 * Performs checks and copies required reader attributes
 */
public final ContentReader getReader() throws ContentIOException
{
    ContentReader reader = createReader();
    if (reader == null)
    {
        throw new AlfrescoRuntimeException("ContentReader failed to create new reader: \n" +
                "   reader: " + this);
    }
    else if (reader.getContentUrl() == null || !reader.getContentUrl().equals(getContentUrl()))
    {
        throw new AlfrescoRuntimeException("ContentReader has different URL: \n" +
                "   reader: " + this + "\n" +
                "   new reader: " + reader);
    }
    // copy across common attributes
    reader.setMimetype(this.getMimetype());
    reader.setEncoding(this.getEncoding());
    reader.setLocale(this.getLocale());
    // done
    if (logger.isDebugEnabled())
    {
        logger.debug("Reader spawned new reader: \n" +
                "   reader: " + this + "\n" +
                "   new reader: " + reader);
    }
    return reader;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:31,代码来源:AbstractContentReader.java

示例3: getRawReader

import org.alfresco.service.cmr.repository.ContentReader; //导入方法依赖的package包/类
/** {@inheritDoc} */
public ContentReader getRawReader(String contentUrl)
{
    ContentReader reader = null;
    try
    {
        reader = store.getReader(contentUrl);
    }
    catch (UnsupportedContentUrlException e)
    {
        // The URL is not supported, so we spoof it
        reader = new EmptyContentReader(contentUrl);
    }
    if (reader == null)
    {
        throw new AlfrescoRuntimeException("ContentStore implementations may not return null ContentReaders");
    }
    // set extra data on the reader
    reader.setMimetype(MimetypeMap.MIMETYPE_BINARY);
    reader.setEncoding("UTF-8");
    reader.setLocale(I18NUtil.getLocale());
    
    // Done
    if (logger.isDebugEnabled())
    {
        logger.debug(
                "Direct request for reader: \n" +
                "   Content URL: " + contentUrl + "\n" +
                "   Reader:      " + reader);
    }
    return reader;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:ContentServiceImpl.java


注:本文中的org.alfresco.service.cmr.repository.ContentReader.setLocale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。