Examples of FileSystem


Examples of cu.ftpd.filesystem.FileSystem

        }
    }

    protected void createAndSetFileSystem() {
        // this will be overridden in cubnc
        fs = new FileSystem(user);
    }
View Full Code Here

Examples of de.waldheinz.fs.FileSystem

            e.printStackTrace();
            System.exit(-1);
        }

        //Format the floppy
        FileSystem fs=null;
        try {
            fs = SuperFloppyFormatter.get(device).format();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.exit(-1);

        }

        //Iterate of directories
        File dir = new File(args[0]);

        String[] children = dir.list();
        if (children == null) {
            // Either dir does not exist or is not a directory
          System.out.println("Error. does the directory exist?");
          System.exit(-1);         
        } else {
            for (int i=0; i<children.length; i++) {
                // Get filename of file or directory
              File aFile=new File(dir.getAbsolutePath()+System.getProperty("file.separator")+children[i]);
             
              try {         
              // Create the entry on the floppy
                FsDirectoryEntry floppyEntry = fs.getRoot().addFile(children[i]);
                //floppyEntry.setName(children[i]);
                System.out.print("- Processing file: "+children[i]+" ");
               
                FsFile floppyfile = floppyEntry.getFile();
             
              // Copy the file over               
              if (aFile.isFile()) {
                FileInputStream fis= new FileInputStream(aFile);
               
                FileChannel fci = fis.getChannel();
                ByteBuffer buffer = ByteBuffer.allocate(1024);
               
                long counter=0;
                  int len;
                 
               //   http://www.kodejava.org/examples/49.html
               // Here we start to read the source file and write it
                    // to the destination file. We repeat this process
                    // until the read method of input stream channel return
                    // nothing (-1).
                    while(true)
                    {
                        // read a block of data and put it in the buffer
                        int read = fci.read(buffer);

                        // did we reach the end of the channel? if yes
                        // jump out the while-loop
                        if (read == -1)
                            break;

                        // flip the buffer
                        buffer.flip();

                        // write to the destination channel
                    System.out.print(".");
                      floppyfile.write(counter*1024, buffer);
                      counter++;

                       
                        // clear the buffer and user it for the next read
                        // process
                        buffer.clear();
                    }
                    System.out.println();
                   
                    floppyfile.flush();

            fis.close();
              }
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
       
              }
            }
        }


        try {
      fs.close();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
       
View Full Code Here

Examples of eu.stratosphere.core.fs.FileSystem

      throw new IllegalConfigurationException(this.getName() + " does not specify an input path");
    }

    // Check if the path is valid
    try {
      final FileSystem fs = this.path.getFileSystem();
      final FileStatus f = fs.getFileStatus(this.path);
      if (f == null) {
        throw new IOException(this.path.toString() + " led to a null object");
      }
    } catch (IOException e) {
      throw new IllegalConfigurationException("Cannot access file or directory: "
View Full Code Here

Examples of fitnesse.wiki.fs.FileSystem

  private FileSystemPageFactory wikiPageFactory;

  @Before
  public void setUp() {
    FileSystem fileSystem = new MemoryFileSystem();
    MemoryVersionsController memoryVersionsController = new MemoryVersionsController(fileSystem);
    wikiPageFactory = new FileSystemPageFactory(fileSystem, memoryVersionsController, new SystemVariableSource());
  }
View Full Code Here

Examples of intellijcoder.os.FileSystem

    private static IntelliJIDEA injectIDE(Project project) {
        return new IntelliJIDEA(project);
    }

    private static FileSystem injectFileSystem() {
        return new FileSystem();
    }
View Full Code Here

Examples of io.fabric8.core.jmx.FileSystem

    private void registerFabricMBeans() {
        this.healthCheck = new HealthCheck(fabricService.get());
        this.managerMBean = new FabricManager((FabricServiceImpl) fabricService.get());
        this.zooKeeperMBean = new ZooKeeperFacade((FabricServiceImpl) fabricService.get());
        this.fileSystemMBean = new FileSystem(runtimeProperties.get());
        healthCheck.registerMBeanServer(shutdownTracker, mbeanServer.get());
        managerMBean.registerMBeanServer(shutdownTracker, mbeanServer.get());
        fileSystemMBean.registerMBeanServer(shutdownTracker, mbeanServer.get());
        zooKeeperMBean.registerMBeanServer(shutdownTracker, mbeanServer.get());
    }
View Full Code Here

Examples of java.nio.file.FileSystem

* Date: 9/7/13
* Time: 10:14 PM
*/
public class InvertUtils {
  public Path getPath(String name) {
    FileSystem fs = FileSystems.getDefault();
    Path path = fs.getPath(name);
    if (path.toFile().exists()) {
      return path;
    } else {
      return fs.getPath("compiler/" + name);
    }
  }
View Full Code Here

Examples of limelight.io.FileSystem

  }

  @Test
  public void configuringFileSystem() throws Exception
  {
    FileSystem fs = new FakeFileSystem();
    Boot.configureContext(Boot.defaultOptions.merge("file-system", fs), context);

    assertSame(fs, Context.fs());
  }
View Full Code Here

Examples of net.sourceforge.fullsync.fs.FileSystem

    buffering = new Hashtable<String, SyncFilesBufferingProvider>();
    buffering.put("syncfiles", new SyncFilesBufferingProvider());
  }

  public final Site createConnection(final ConnectionDescription desc) throws FileSystemException, IOException, URISyntaxException {
    FileSystem fs = null;

    URI url = desc.getUri();
    String scheme = url.getScheme();

    if (scheme != null) {
      fs = schemes.get(scheme);
    }
    if (fs == null) {
      // TODO maybe we should test and correct this in profile dialog !?
      // no fs found, test for native path
      File f = new File(url.toString()); // ignore query as local won't need query
      if (f.exists()) {
        fs = schemes.get("file");
        url = f.toURI();
        desc.setUri(url);
      }
      else {
        throw new URISyntaxException(url.toString(), "Not a valid uri or unknown scheme");
      }
    }

    Site s = fs.createConnection(desc);

    String bufferStrategy = desc.getParameter("bufferStrategy");

    if ((null != bufferStrategy) && !"".equals(bufferStrategy)) {
      s = resolveBuffering(s, bufferStrategy);
View Full Code Here

Examples of org.apache.commons.configuration.FileSystem

      // else try a standard configuration
      if (_fileConfiguration == null)
        try
        {
          // enable VFS
          FileSystem fs = new VFSFileSystem();
          fs.setFileOptionsProvider(new FileOptionsProvider()
          {

            public Map getOptions()
            {
              Map result = new HashMap();
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.