Tabnine Logo
PortableFileSystem.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
org.kframework.krun.ioserver.filesystem.portable.PortableFileSystem

Best Java code snippets using org.kframework.krun.ioserver.filesystem.portable.PortableFileSystem.get (Showing top 2 results out of 315)

origin: kframework/k

public void close(long fd) throws IOException {
  File f = get(fd);
  assert f instanceof org.kframework.krun.ioserver.filesystem.portable.File;
  ((org.kframework.krun.ioserver.filesystem.portable.File)f).close();
  files.remove(descriptors.get(fd));
  descriptors.remove(fd);
}
origin: kframework/k

@Test
public void testReadFile() throws Exception {
  when(files.resolveWorkingDirectory(Matchers.anyString())).thenAnswer(new Answer<java.io.File>() {
    @Override
    public java.io.File answer(InvocationOnMock invocation)
        throws Throwable {
      return new java.io.File((String)invocation.getArguments()[0]);
    }
  });
  PortableFileSystem fs = new PortableFileSystem(kem, files);
  long fd = fs.open(new java.io.File(getClass().getResource("/fs-test.txt").toURI()).getAbsolutePath(), "r");
  File f = fs.get(fd);
  byte[] file = "foo\n".getBytes(Charset.forName("ASCII"));
  Assert.assertArrayEquals(file, f.read(4));
  try {
    f.read(1);
    Assert.fail();
  } catch (IOException e) {
    Assert.assertEquals("EOF", e.getMessage());
  }
}
org.kframework.krun.ioserver.filesystem.portablePortableFileSystemget

Popular methods of PortableFileSystem

  • <init>
  • open
  • processErrno
  • processFileNotFoundException
  • processIOException

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now