Package com.zaranux.client.api.exceptions

Examples of com.zaranux.client.api.exceptions.ResourceNotFound


   
    path = getPhysicalPath(path);

    File f = new File(path);
    if(!f.exists())
      throw new ResourceNotFound();
    if(!f.isDirectory())
      throw new NotDirectory();
    String[] lf = f.list();

    String[] list = null;
View Full Code Here


  protected InputStream readStream(String path, long from , int lenthrows SystemCallNotSupported,ResourceNotFound, NotFile {
    if(isLocal(path)) throw new SystemCallNotSupported();
    path = getPhysicalPath(path);
    File file = new File(path);
    if(!file.exists())
      throw new ResourceNotFound();
    if(!file.isFile())
      throw new NotFile();
    FileInputStream fis = null;
    try
    {
View Full Code Here

   
    path = getPhysicalPath(path);
    File file = new File(path);
   
    if(!file.exists())
      throw new ResourceNotFound();
    if(!file.isFile())
      throw new NotFile();
   
    byte[] bytes = null;
    FileInputStream fis = null;
View Full Code Here

   
    File file = new File(path);
   
   
    if(append && !file.exists())
      throw new ResourceNotFound();
   
    FileOutputStream fos = null;
    try{
      fos = new FileOutputStream(path,append);
       
      if(isBase64)
      {
        new BASE64Decoder().decodeBuffer(is, fos);
      }else{
        byte[] b = new byte[BUFFER_SIZE];
        int len = -1;
        while( (len = is.read(b) ) > 0)
        {
          fos.write(b, 0, len);
        }
      }
      success = true;
    }catch(FileNotFoundException e)
    {
      throw new ResourceNotFound();
    }catch(IOException e)
    {
      throw new ResourceAccessFailed();
    }finally
    {
View Full Code Here

    }else
    {
   
      File f = new File(path);
      if(!f.exists())
        throw new ResourceNotFound();
      String[] lf = f.list();
      list = new String[lf.length];
      if(lf!=null)
      {
        for(int i=0; i<lf.length; i++)
View Full Code Here

          len = Math.min(fis.available(),len);
          bytes = new byte[len];
          int bytesRead = fis.read(bytes);
        }else
        {
          throw new ResourceNotFound();
        }
      }catch(IOException e)
      {
        throw new ResourceAccessFailed();
      }finally
View Full Code Here

        {
        public void onSuccess(Boolean exists)
        {
          if(! exists)
          {
            callback.onFailure(new ResourceNotFound());
            return;
          }

          String name = file.getName();
          final String aclDirPath = file.getParent() + "/.zaranux/.meta/";
View Full Code Here

TOP

Related Classes of com.zaranux.client.api.exceptions.ResourceNotFound

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.