Package com.bradmcevoy.http

Examples of com.bradmcevoy.http.Resource


     * @return - null if couldnt search. a list which might contain more then zero
     * elements
     */
    public List<Resource> childrenWithFilter(String sPattern) {
        log.debug("findWithWildCard");
        Resource r = getResource();
        ifr == null ){
            msg = "no current resource for path: " + path;
            return null;
        }
        if( !(r instanceof CollectionResource) ) {
            log.debug( "resource is not a collectionresource. is a: " + r.getClass());
            msg = "not a folder " + path;
            return null;
        }
        CollectionResource cur = (CollectionResource) r;
        Pattern pattern = null;
View Full Code Here


        if (LOG.isTraceEnabled()) {
            LOG.trace(String.format("Create '%s' in '%s'", newName, resourceXmldbUri));
        }

        Resource resource = null;
        try {
            // submit
            XmldbURI resourceURI = existCollection.createFile(newName, is, length, contentType);

            resource = new MiltonDocument(host, resourceURI, brokerPool, subject);
View Full Code Here

  public List<? extends Resource> getChildren() {
    ArrayList<Resource> list = new ArrayList<Resource>();
    File[] files = this.realFile.listFiles();
    if( files != null ) {
      for( File fchild : files ) {
        Resource res = factory.resolveFile( this.host, fchild );
        if( res != null ) {
          list.add( res );
        } else {
          LOGGER.error("Couldn't resolve file - " + fchild.getAbsolutePath());
        }
View Full Code Here

  public List<? extends Resource> getChildren() {
    ArrayList<Resource> list = new ArrayList<Resource>();
    File[] files = this.realFile.listFiles();
    if( files != null ) {
      for( File fchild : files ) {
        Resource res = factory.resolveFile( this.host, fchild );
        if( res != null ) {
          list.add( res );
        } else {
          LOGGER.error("Couldn't resolve file - " + fchild.getAbsolutePath());
        }
View Full Code Here

 
 
  @Override
  public Resource createNew(String name, InputStream in, Long length,
      String contentType) throws IOException {
    Resource res = null;
    if(".tokens".equals(name) || ".request".equals(name) || ".response".equals(name)){
      res = super.createNew(name, in, length, contentType);
    }
    return res;
  }
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 createNew(String newName, InputStream inputStream, Long length, String contentType) throws IOException, ConflictException
  {
    if(logger.isInfoEnabled())
      logger.info("Creating new asset:" + newName + ":" + length + ":" + contentType);
   
    Resource resource = null;
    try
    {
      DigitalAssetVO digitalAsset = null;
     
      List<DigitalAssetVO> assetVOList = DigitalAssetController.getController().getDigitalAssetVOList(this.contentVersion.getId());
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 createNew(String newName, InputStream inputStream,
      Long length, String contentType) throws IOException,
      ConflictException, NotAuthorizedException, BadRequestException {

    Resource existingChild = child(newName);
    if (existingChild == null) {

      V7File child = file.createChild(inputStream, newName, contentType);

      return new FileResource(child, factory);
View Full Code Here

    return existingChild;
  }

  Resource createNew(String newName, ContentPointer content,
      String contentType) throws IOException, ConflictException {
    Resource existingChild = child(newName);
    if (existingChild == null) {

      V7File child = file.createChild(content, newName, contentType);

      return new FileResource(child, factory);
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.