Tabnine Logo
RamFileSystemConfigBuilder.getInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
getInstance
method
in
org.apache.commons.vfs2.provider.ram.RamFileSystemConfigBuilder

Best Java code snippets using org.apache.commons.vfs2.provider.ram.RamFileSystemConfigBuilder.getInstance (Showing top 10 results out of 315)

origin: com.github.abashev/commons-vfs2

/**
 * @param newSize
 * @throws IOException if the new size exceeds the limit
 */
synchronized void resize(final long newSize) throws IOException {
  final RamFileSystem afs = getAbstractFileSystem();
  final FileSystemOptions afsOptions = afs.getFileSystemOptions();
  if (afsOptions != null) {
    final long maxSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(afsOptions);
    if (afs.size() + newSize - this.size() > maxSize) {
      throw new IOException("FileSystem capacity (" + maxSize + ") exceeded.");
    }
  }
  this.data.resize(newSize);
}
origin: org.apache.commons/commons-vfs2

/**
 * @param newSize
 * @throws IOException if the new size exceeds the limit
 */
synchronized void resize(final long newSize) throws IOException {
  final RamFileSystem afs = getAbstractFileSystem();
  final FileSystemOptions afsOptions = afs.getFileSystemOptions();
  if (afsOptions != null) {
    final long maxSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(afsOptions);
    if (afs.size() + newSize - this.size() > maxSize) {
      throw new IOException("FileSystem capacity (" + maxSize + ") exceeded.");
    }
  }
  this.data.resize(newSize);
}
origin: apache/commons-vfs

/**
 * @param newSize
 * @throws IOException if the new size exceeds the limit
 */
synchronized void resize(final long newSize) throws IOException {
  final RamFileSystem afs = getAbstractFileSystem();
  final FileSystemOptions afsOptions = afs.getFileSystemOptions();
  if (afsOptions != null) {
    final long maxSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(afsOptions);
    if (afs.size() + newSize - this.size() > maxSize) {
      throw new IOException("FileSystem capacity (" + maxSize + ") exceeded.");
    }
  }
  this.data.resize(newSize);
}
origin: org.jetbrains.intellij.deps/commons-vfs2

/**
 * @param newSize
 * @throws IOException
 *             if the new size exceeds the limit
 */
synchronized void resize(final long newSize) throws IOException
{
  final RamFileSystem afs = getAbstractFileSystem();
  final FileSystemOptions afsOptions = afs.getFileSystemOptions();
  if (afsOptions != null)
  {
    final long maxSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(afsOptions);
    if (afs.size() + newSize - this.size() > maxSize)
    {
      throw new IOException("FileSystem capacity (" + maxSize + ") exceeded.");
    }
  }
  this.data.resize(newSize);
}
origin: org.apache.commons/commons-vfs2

@Before
public void setUp() throws Exception {
  manager = new DefaultFileSystemManager();
  manager.addProvider("ram", new RamFileProvider());
  manager.init();
  // File Systems Options
  RamFileSystemConfigBuilder.getInstance().setMaxSize(zeroSizedFso, 0L);
  RamFileSystemConfigBuilder.getInstance().setMaxSize(smallSizedFso, 10L);
}
origin: org.jetbrains.intellij.deps/commons-vfs2

@Before
public void setUp() throws Exception
{
  manager = new DefaultFileSystemManager();
  manager.addProvider("ram", new RamFileProvider());
  manager.init();
  // File Systems Options
  RamFileSystemConfigBuilder.getInstance().setMaxSize(zeroSizedFso, 0L);
  RamFileSystemConfigBuilder.getInstance().setMaxSize(smallSizedFso, 10L);
}
origin: apache/commons-vfs

@Before
public void setUp() throws Exception {
  manager = new DefaultFileSystemManager();
  manager.addProvider("ram", new RamFileProvider());
  manager.init();
  // File Systems Options
  RamFileSystemConfigBuilder.getInstance().setMaxSize(zeroSizedFso, 0L);
  RamFileSystemConfigBuilder.getInstance().setMaxSize(smallSizedFso, 10L);
}
origin: org.apache.commons/commons-vfs2

@Test
public void testFSOptions() throws Exception {
  // Default FS
  final FileObject fo1 = manager.resolveFile("ram:/");
  final FileObject fo2 = manager.resolveFile("ram:/");
  assertTrue("Both files should exist in the same fs instance.", fo1.getFileSystem() == fo2.getFileSystem());
  FileSystemOptions fsOptions = fo1.getFileSystem().getFileSystemOptions();
  long maxFilesystemSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(fsOptions);
  assertEquals("Filesystem option maxSize must be unlimited", Long.MAX_VALUE, maxFilesystemSize);
  // Small FS
  final FileObject fo3 = manager.resolveFile("ram:/fo3", smallSizedFso);
  final FileObject fo4 = manager.resolveFile("ram:/", smallSizedFso);
  assertTrue("Both files should exist in the same FileSystem instance.",
      fo3.getFileSystem() == fo4.getFileSystem());
  assertTrue("Both files should exist in different FileSystem instance.",
      fo1.getFileSystem() != fo3.getFileSystem());
  fsOptions = fo3.getFileSystem().getFileSystemOptions();
  maxFilesystemSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(fsOptions);
  assertEquals("Filesystem option maxSize must be set", 10, maxFilesystemSize);
}
origin: org.jetbrains.intellij.deps/commons-vfs2

@Test
public void testFSOptions() throws Exception
{
  // Default FS
  final FileObject fo1 = manager.resolveFile("ram:/");
  final FileObject fo2 = manager.resolveFile("ram:/");
  assertTrue("Both files should exist in the same fs instance.", fo1.getFileSystem() == fo2.getFileSystem());
  FileSystemOptions fsOptions = fo1.getFileSystem().getFileSystemOptions();
  long maxFilesystemSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(fsOptions);
  assertEquals("Filesystem option maxSize must be unlimited", Long.MAX_VALUE, maxFilesystemSize);
  // Small FS
  final FileObject fo3 = manager.resolveFile("ram:/fo3", smallSizedFso);
  final FileObject fo4 = manager.resolveFile("ram:/", smallSizedFso);
  assertTrue("Both files should exist in the same FileSystem instance.", fo3.getFileSystem() == fo4.getFileSystem());
  assertTrue("Both files should exist in different FileSystem instance.", fo1.getFileSystem() != fo3.getFileSystem());
  fsOptions = fo3.getFileSystem().getFileSystemOptions();
  maxFilesystemSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(fsOptions);
  assertEquals("Filesystem option maxSize must be set", 10, maxFilesystemSize);
}
origin: apache/commons-vfs

@Test
public void testFSOptions() throws Exception {
  // Default FS
  final FileObject fo1 = manager.resolveFile("ram:/");
  final FileObject fo2 = manager.resolveFile("ram:/");
  assertTrue("Both files should exist in the same fs instance.", fo1.getFileSystem() == fo2.getFileSystem());
  FileSystemOptions fsOptions = fo1.getFileSystem().getFileSystemOptions();
  long maxFilesystemSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(fsOptions);
  assertEquals("Filesystem option maxSize must be unlimited", Long.MAX_VALUE, maxFilesystemSize);
  // Small FS
  final FileObject fo3 = manager.resolveFile("ram:/fo3", smallSizedFso);
  final FileObject fo4 = manager.resolveFile("ram:/", smallSizedFso);
  assertTrue("Both files should exist in the same FileSystem instance.",
      fo3.getFileSystem() == fo4.getFileSystem());
  assertTrue("Both files should exist in different FileSystem instance.",
      fo1.getFileSystem() != fo3.getFileSystem());
  fsOptions = fo3.getFileSystem().getFileSystemOptions();
  maxFilesystemSize = RamFileSystemConfigBuilder.getInstance().getLongMaxSize(fsOptions);
  assertEquals("Filesystem option maxSize must be set", 10, maxFilesystemSize);
}
org.apache.commons.vfs2.provider.ramRamFileSystemConfigBuildergetInstance

Javadoc

Gets the singleton builder.

Popular methods of RamFileSystemConfigBuilder

  • getLongMaxSize
    Defaults to Integer#MAX_VALUE.
  • getLong
  • setParam
  • setMaxSize
    Sets the maximum size of the file system.

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Github Copilot alternatives
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