Package org.jboss.virtual.spi

Examples of org.jboss.virtual.spi.Options


            try
            {
               VFSContext context = getVFSContext();
               String path = getPathName();

               Options options = context.getOptions();
               VirtualFileHandler oldRoot = options.getOption(VirtualFileHandler.class);
               if (oldRoot == null)
               {
                  StringBuffer buf = new StringBuffer();

                  URI rootURI = context.getRootURI();
View Full Code Here


    *
    * @return true if temporary, false otherwise
    */
   protected boolean isTemporary()
   {
      Options options = getVFSContext().getOptions();
      return options.getBooleanOption(VFSUtils.IS_TEMP_FILE);
   }
View Full Code Here

      VFSContext oldVFSContext = handler.getVFSContext();
      // 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

    * @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

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.