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

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

Best Java code snippets using org.apache.commons.vfs2.provider.ram.RamFileSystemConfigBuilder.getLongMaxSize (Showing top 7 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

@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.ramRamFileSystemConfigBuildergetLongMaxSize

Javadoc

Defaults to Integer#MAX_VALUE.

Popular methods of RamFileSystemConfigBuilder

  • getInstance
    Gets the singleton builder.
  • getLong
  • setParam
  • setMaxSize
    Sets the maximum size of the file system.

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top plugins for Android Studio
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