Package org.jboss.virtual.spi

Examples of org.jboss.virtual.spi.Options


    * @param exactType the exact type
    * @return key's option
    */
   public static <T> T getOption(VirtualFile file, String key, Class<T> exactType)
   {
      Options options = getOptions(file);
      return options != null ? options.getOption(key, exactType) : null;
   }
View Full Code Here


    * @param exactType the exact type
    * @return key's option
    */
   public static <T> T getOption(VFS vfs, String key, Class<T> exactType)
   {
      Options options = getOptions(vfs);
      return options != null ? options.getOption(key, exactType) : null;
   }
View Full Code Here

    * @param file the file
    * @param optionName option name
    */
   protected static void enableOption(VirtualFile file, String optionName)
   {
      Options options = getOptions(file);
      if (options == null)
         throw new IllegalArgumentException("Cannot enable " + optionName + " on null options: " + file);

      options.addOption(optionName, Boolean.TRUE);
   }
View Full Code Here

    * @param file the file
    * @param optionName option name
    */
   protected static void disableOption(VirtualFile file, String optionName)
   {
      Options options = getOptions(file);
      if (options == null)
         throw new IllegalArgumentException("Cannot disable " + optionName + " on null options: " + file);

      options.removeOption(optionName);
   }
View Full Code Here

    * @param vfs the vfs
    * @param optionName option name
    */
   protected static void enableOption(VFS vfs, String optionName)
   {
      Options options = getOptions(vfs);
      if (options == null)
         throw new IllegalArgumentException("Cannot enable " + optionName + " on null options: " + vfs);

      options.addOption(optionName, Boolean.TRUE);
   }
View Full Code Here

    * @param vfs the vfs
    * @param optionName option name
    */
   protected static void disableOption(VFS vfs, String optionName)
   {
      Options options = getOptions(vfs);
      if (options == null)
         throw new IllegalArgumentException("Cannot disable " + optionName + " on null options: " + vfs);

      options.removeOption(optionName);
   }
View Full Code Here

    * @param file the file
    * @return true if temporary, false otherwise
    */
   public static boolean isTemporaryFile(VirtualFile file)
   {
      Options options = getOptions(file);
      return options.getBooleanOption(IS_TEMP_FILE);
   }
View Full Code Here

      String path = handler.getPathName();
      // create new handler
      FileSystemContext fileSystemContext = new TempContext(copy, oldVFSContext, path);

      // merge old options
      Options newOptions = fileSystemContext.getOptions();
      if (newOptions != null) // shouldn't be null, but we check anyway
      {
         Options oldOptions = oldVFSContext.getOptions();
         if (oldOptions != null && oldOptions.size() > 0)
            newOptions.merge(oldOptions);

         newOptions.addOption(VFSUtils.IS_TEMP_FILE, Boolean.TRUE);
         // save old handler
         newOptions.addOption(VirtualFileHandler.class.getName(), handler);
View Full Code Here

    *
    * @return map containing aggregated options
    */
   public Options getAggregatedOptions()
   {
      Options aggregatedOptions = createNewOptions();
      VFSContext peerContext = getPeerContext();
      if (peerContext != null)
         aggregatedOptions.merge(peerContext.getOptions());
      aggregatedOptions.merge(super.getOptions()); // put them after peer, possible override
      return aggregatedOptions;
   }
View Full Code Here

         realURL = urlInfo.toURL();
         return wrapper;
      }
      else
      {
         Options aggregatedOptions = getAggregatedOptions();
         boolean noReaper = aggregatedOptions.getBooleanOption(VFSUtils.NO_REAPER_QUERY);
         realURL = urlInfo.toURL();
         boolean isAutoClean = autoClean || aggregatedOptions.getBooleanOption(VFSUtils.IS_TEMP_FILE);
         return new ZipFileWrapper(file, isAutoClean, noReaper);
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.virtual.spi.Options

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.