Package com.bradmcevoy.http

Examples of com.bradmcevoy.http.Resource


  @Override
  public void copyTo(CollectionResource to, String name)
      throws NotAuthorizedException, BadRequestException,
      ConflictException {
    FolderResource newParent = (FolderResource) to;
    Resource existing = newParent.child(name);
    if (existing != null)
      throw new ConflictException();
    FolderResource copy = (FolderResource) newParent.createCollection(name);
    for (Resource child : getChildren()) {
      ((CopyableResource) child).copyTo(copy, child.getName());
View Full Code Here


  public void copyTo(CollectionResource to, String name)
      throws NotAuthorizedException, BadRequestException,
      ConflictException {
    FolderResource newParent = (FolderResource) to;
    Resource existing = newParent.child(name);
    if (existing != null)
      throw new ConflictException();
    try {
      // avoid copying the data, just copy the ContentPointer
      newParent.createNew(name, file.getContentPointer(), file
View Full Code Here

{
  private final static Logger logger = Logger.getLogger(InfogluePathResolver.class.getName());

  public static Resource resolvePath(Path path, RepositoryResourceFactory resourceFactory)
  {
    Resource resource = null;
   
    int i=0;
    for(String part : path.getParts())
    {
      i++;
View Full Code Here

    if(logger.isInfoEnabled())
      logger.info("children:" + children.size());
    Iterator<? extends Resource> childrenIterator = children.iterator();
    while(childrenIterator.hasNext())
    {
      Resource resource = childrenIterator.next();
      if(logger.isInfoEnabled())
        logger.info("resource.getName():" + resource.getName());
     
      if(resource.getName().equals(name))
      {
        return resource;
      }
    }
    return null;
View Full Code Here

   
    List<? extends Resource> children = getChildren();
    Iterator<? extends Resource> childrenIterator = children.iterator();
    while(childrenIterator.hasNext())
    {
      Resource resource = childrenIterator.next();
      if(resource.getName().equals(name))
      {
        return resource;
      }
    }
    return null;
View Full Code Here

 
  public Resource getResource(String host, String p)
  {   
    Path path = Path.path(p).getStripFirst();
   
    Resource resource = InfogluePathResolver.resolvePath(path, this);
   
    if(logger.isInfoEnabled())
      logger.info("Returning resource:" + resource);
   
    return resource;
View Full Code Here

TOP

Related Classes of com.bradmcevoy.http.Resource

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.