Package org.apache.commons.vfs2

Examples of org.apache.commons.vfs2.FileSystemException


                                         final Throwable throwable)
    {
        Object[] parmArray = params;
        if (throwable instanceof FileSystemException)
        {
            final FileSystemException fse = (FileSystemException) throwable;

            // Compare message code and params
            assertEquals(code, fse.getCode());
            assertEquals(params.length, fse.getInfo().length);
            parmArray = new Object[params.length];
            for (int i = 0; i < params.length; i++)
            {
                String value = String.valueOf(params[i]);
                // mask passwords (VFS-169)
                final Matcher urlMatcher = URL_PATTERN.matcher(value);
                if (urlMatcher.find())
                {
                    final Matcher pwdMatcher = PASSWORD_PATTERN.matcher(value);
                    value = pwdMatcher.replaceFirst(":***@");
                }
                assertEquals(value, fse.getInfo()[i]);
                parmArray[i] = value;
            }
        }

        // Compare formatted message
View Full Code Here


            parent.attachChild(fileObj.getName());
          }
        }

      } catch (RarException e) {
        throw new FileSystemException(e);
      } catch (IOException e) {
        throw new FileSystemException(e);
      }
    } finally {
      // closeCommunicationLink();
    }
  }
View Full Code Here

  }

  @Override
  protected InputStream doGetInputStream() throws Exception {
    if (!getType().hasContent()) {
      throw new FileSystemException("vfs.provider/read-not-file.error",
          getName());
    }
    return archive.getInputStream(header);
  }
View Full Code Here

    return FileType.IMAGINARY;
  }

  @Override
  protected String[] doListChildren() throws Exception {
    throw new FileSystemException("File doesn't exist");
  }
View Full Code Here

    throw new FileSystemException("File doesn't exist");
  }

  @Override
  protected long doGetContentSize() throws Exception {
    throw new FileSystemException("File doesn't exist");
  }
View Full Code Here

    throw new FileSystemException("File doesn't exist");
  }

  @Override
  protected InputStream doGetInputStream() throws Exception {
    throw new FileSystemException("File doesn't exist");
  }
View Full Code Here

    return 0;
  }

  @Override
  protected InputStream doGetInputStream() throws Exception {
    throw new FileSystemException("can't open directory!");
  }
View Full Code Here

     * @see org.apache.commons.vfs2.provider.AbstractFileSystem#createFile(org.apache.commons.vfs2.provider.AbstractFileName)
     */
    @Override
    protected FileObject createFile(final AbstractFileName name) throws Exception
    {
        throw new FileSystemException("Operation not supported");
    }
View Full Code Here

                    fs = org.apache.hadoop.fs.FileSystem.get(conf);
                }
                catch (final IOException e)
                {
                    log.error("Error connecting to filesystem " + hdfsUri, e);
                    throw new FileSystemException("Error connecting to filesystem " + hdfsUri, e);
                }
            }
        }

        boolean useCache = (null != getContext().getFileSystemManager().getFilesCache());
View Full Code Here

      final FileObject destFile = context.toFileObject(file);
      destFile.copyFrom(srcFile, selector);

      return file;
    } catch (IOException e) {
      throw new FileSystemException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs2.FileSystemException

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.