Package org.terrier.utility.io

Examples of org.terrier.utility.io.FileSystem.capabilities()


  {
    path = transform(path);
        final FileSystem fs = getFileSystem(path);
        if (fs == null)
            return null;
        if ((fs.capabilities() & FSCapability.STAT) == 0)
            return null;
        try{
            return fs.getParent(path);
        } catch (IOException ioe) {
            return null;
View Full Code Here


  {
    path = transform(path);
        final FileSystem fs = getFileSystem(path);
        if (fs == null)
            return EMPTY_STRING_ARRAY;
        if ((fs.capabilities() & FSCapability.LS_DIR) == 0)
            return EMPTY_STRING_ARRAY;
        try{
            return fs.list(path);
        } catch (IOException ioe) {
            return EMPTY_STRING_ARRAY;
View Full Code Here

  {
    filename = transform(filename);
    final FileSystem fs = getFileSystem(filename);
    if (fs == null)
      throw new FileNotFoundException("No file system for "+filename);
    if ((fs.capabilities() & FSCapability.READ) == 0)
      throw new IOException("File system not supporting reads for "+ filename);
       
    InputStream rtr = fs.openFileStream(filename);
    for(Pattern regex : inputStreamMap.keySet())
    {
View Full Code Here

  {
    filename = transform(filename);
    final FileSystem fs = getFileSystem(filename);
    if (fs == null)
      throw new FileNotFoundException("No file system for "+filename);
    if ((fs.capabilities() & FSCapability.WRITE) == 0)
      throw new IOException("File system not supporting writes for "+ filename);
    OutputStream rtr = fs.writeFileStream(filename);
    for(Pattern regex : outputStreamMap.keySet())
    {
      if (regex.matcher(filename).matches())
View Full Code Here

  {
    filename = transform(filename);
    final FileSystem fs = getFileSystem(filename);
    if (fs == null)
      throw new FileNotFoundException("No file system for "+filename);
    if ((fs.capabilities() & FSCapability.RANDOM_READ) == 0)
      throw new IOException("File system not supporting random reads for "+ filename);
    return fs.openFileRandom(filename);
  }

  /** Returns a RandomAccessFile implementation accessing the specificed file */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.