Package org.jboss.forge.addon.resource

Examples of org.jboss.forge.addon.resource.ResourceException


   private JavaResource getJavaResource(final DirectoryResource sourceDir, final String relativePath)
   {
      if (Strings.isNullOrEmpty(relativePath))
      {
         throw new ResourceException("Empty relative path");
      }
      String path = relativePath.trim().endsWith(".java")
               ? relativePath.substring(0, relativePath.lastIndexOf(".java")) : relativePath;

      path = Packages.toFileSyntax(path) + ".java";
View Full Code Here


      {
         return subset.get(0);
      }
      else if (subset.size() > 1)
      {
         throw new ResourceException("Ambiguous name [" + name + "], full type signature required");
      }
      else
      {
         return null;
      }
View Full Code Here

      {
         return getJavaType().getQualifiedName();
      }
      catch (FileNotFoundException e)
      {
         throw new ResourceException("Error while fetching the qualified name", e);
      }
      catch (Exception e)
      {
         return getName();
      }
View Full Code Here

      {
         return subset.get(0);
      }
      else if (subset.size() > 1)
      {
         throw new ResourceException("Ambiguous name [" + name + "], full type signature required");
      }
      else
      {
         return null;
      }
View Full Code Here

      {
         return getJavaSource().getQualifiedName();
      }
      catch (FileNotFoundException e)
      {
         throw new ResourceException(e);
      }
      catch (Exception e)
      {
         return getName();
      }
View Full Code Here

      Resource<?> result = getChild(name);
      if (!(result instanceof DirectoryResourceImpl))
      {
         if (result.exists())
         {
            throw new ResourceException("The resource [" + result.getFullyQualifiedName()
                     + "] is not a DirectoryResource");
         }
      }

      if (!(result instanceof DirectoryResourceImpl))
View Full Code Here

      {
         result = (T) child;
      }
      else if (child.exists())
      {
         throw new ResourceException("Requested resource [" + name + "] was not of type [" + type.getName()
                  + "], but was instead [" + child.getClass().getName() + "]");
      }
      else
      {
         E underlyingResource = (E) child.getUnderlyingResourceObject();
View Full Code Here

         tempFile.delete();
         return createFrom(tempFile);
      }
      catch (IOException e)
      {
         throw new ResourceException(e);
      }
   }
View Full Code Here

   @Override
   public DirectoryResourceImpl createFrom(final File file)
   {
      if (file.exists() && !file.isDirectory())
      {
         throw new ResourceException("File reference is not a directory: " + file.getAbsolutePath());
      }
      else if (!file.exists())
      {
         file.mkdirs();
      }
View Full Code Here

      {
         tempWorkspace = File.createTempFile("Forge_RT", null);
      }
      catch (IOException io)
      {
         throw new ResourceException(io);
      }
      tempWorkspace.delete();
      tempWorkspace.mkdir();
      this.factoryImpl = factoryImpl;
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.resource.ResourceException

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.