Package org.apache.myfaces.trinidad.share.io

Examples of org.apache.myfaces.trinidad.share.io.InputStreamProvider


  {
    long timestamp = StyleSheetDocument.UNKNOWN_TIMESTAMP;

    // The only way to get the timestamp is through the
    // InputStreamProvider.
    InputStreamProvider provider = XMLUtils.getInputStreamProvider(context);

    if (provider != null)
    {
      // And this only works if we are using a File-based or URL-based InputStream
      Object identifier = provider.getIdentifier();
      if (identifier instanceof File)
      {
        timestamp = ((File)identifier).lastModified();
      }
      else if (identifier instanceof URL)
View Full Code Here


    long timestamp = StyleSheetDocument.UNKNOWN_TIMESTAMP;

    // The only way to get the timestamp is through the
    // InputStreamProvider.
    InputStreamProvider provider = XMLUtils.getInputStreamProvider(parseContext);

    if (provider != null)
    {
      // And this only works if we are using a File-based or URL-based InputStream
      Object identifier = provider.getIdentifier();
      if (identifier instanceof File)
        timestamp = ((File)identifier).lastModified();
      else if (identifier instanceof URL)
      {
        try
View Full Code Here

   * cannot be resolved, throw an IOException.
   * @param name the name of the target
   */
  public InputStreamProvider getProvider(String name) throws IOException
  {
    InputStreamProvider provider = _base.getProvider(name);
    InputStreamProvider cached = _getCachedProvider(provider.getIdentifier());
    if (cached != null)
      return cached;

    return new CachingProvider(provider, _cachedFiles, _msBetweenChecks);
  }
View Full Code Here

  private InputStreamProvider _getCachedProvider(Object o)
  {
    // We don't require the storage to be synchronized
    synchronized (_cachedFiles)
    {
      InputStreamProvider provider = _cachedFiles.get(o);
      if ((provider != null) && _checkModified())
      {
        if (provider.hasSourceChanged())
        {
          _cachedFiles.remove(o);
          provider = null;
        }
      }
View Full Code Here

  private static NameResolver _getNameResolverForStyleSheetFile(
    StyleContext context,
    File         localStylesDir,
    String       filename) throws IOException
  {
    InputStreamProvider provider = null;
   
    File file = StyleSheetEntry.resolveLocalFile(localStylesDir, filename);
    if (file != null)
      provider = new FileInputStreamProvider(file);
   
View Full Code Here

    List<NameResolver> resolvers = ClassLoaderUtils.getServices(
                                      _NAME_RESOLVER_CLASS_NAME);

    for (NameResolver customNameResolver : resolvers)
    {
      InputStreamProvider provider = null;
      try
      {
        provider = customNameResolver.getProvider(name);
      }
      catch (IOException e)
View Full Code Here

    ImageContext context,
    Map<Object, Object> properties,
    Object     key
    )
  {
    InputStreamProvider provider = (InputStreamProvider)
      properties.get(key);

    // If we can't get a provider, we can't get an Image
    if (provider == null)
    {
      _log(properties,
           _PROVIDER_ERROR + " (" + _getKeyName(key) + ")",
           null);

      return null;
    }

    InputStream in = null;

    try
    {
      in = provider.openInputStream();
    }
    catch (IOException e)
    {
      _log(properties, _INPUT_STREAM_ERROR, e);
      return null;
View Full Code Here

     
      return Collections.emptyList();
    }
   
    // Step 2. Find an InputStreamProvider. Mark a dependency on the base provider (if necessary)
    InputStreamProvider importProvider = resolver.getProvider(sourceName);
    InputStreamProvider baseProvider = XMLUtils.getInputStreamProvider(context);
    if (baseProvider instanceof CachingInputStreamProvider)
    {
      // important: hasSourceChanged takes into account this dependency
      ((CachingInputStreamProvider)baseProvider).addCacheDependency(importProvider);
    }
View Full Code Here

      return null;
    }

    // Step 2. Find an InputStreamProvider.  Mark a dependency on the base
    // provider (if necessary)
    InputStreamProvider provider = resolver.getProvider(sourceName);
    InputStreamProvider baseProvider = getInputStreamProvider(context);
    if (baseProvider instanceof CachingInputStreamProvider)
    {
      // set the dependency; hasSourceChanged also checks if the
      // dependencies have changed
      ((CachingInputStreamProvider) baseProvider).addCacheDependency(provider);
View Full Code Here

    boolean disabled = CacheUtils.getBoolean(properties, DISABLED_KEY, false);
    boolean textAntialias = CacheUtils.isTextAntialiased(properties);
    char accessKey = _getChar(properties, ACCESS_KEY_KEY);
    String name = (String)properties.get(NAME_KEY);

    InputStreamProvider startIcon = _getIcon(properties,
                                             BUTTON_START_ICON_KEY);
    InputStreamProvider endIcon = _getIcon(properties,
                                           BUTTON_END_ICON_KEY);
    InputStreamProvider topBackgroundIcon = _getIcon(properties,
                                             BUTTON_TOP_BACKGROUND_ICON_KEY);
    InputStreamProvider bottomBackgroundIcon = _getIcon(properties,
                                            BUTTON_BOTTOM_BACKGROUND_ICON_KEY);


    _init(context,
         lookAndFeelId,
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.share.io.InputStreamProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.