Codota Logo
RamFileSystemConfigBuilder.getLongMaxSize
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
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

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • orElseThrow (Optional)
  • setContentView (Activity)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now