Codota Logo
Resource.dir
Code IndexAdd Codota to your IDE (free)

How to use
dir
method
in
org.geoserver.platform.resource.Resource

Best Java code snippets using org.geoserver.platform.resource.Resource.dir (Showing top 20 results out of 315)

  • Common ways to obtain Resource
private void myMethod () {
Resource r =
  • Codota IconGeoServerResourceLoader geoServerResourceLoader;String path;geoServerResourceLoader.get(path)
  • Codota IconResourceStore resourceStore;String path;resourceStore.get(path)
  • Codota IconFile file;Files.asResource(file)
  • Smart code suggestions by Codota
}
origin: geoserver/geoserver

/**
 * Returns the configuration file for the specified namespace, if the file does not exist a file
 * object is still returned.
 *
 * @deprecated As of GeoServer 2.6, replaced by {@link #get(WorkspaceInfo, String...)}
 */
@Deprecated
public File findOrResolveNamespaceFile(WorkspaceInfo ws) throws IOException {
  Resource directory = get(ws);
  return directory.dir();
}
origin: geoserver/geoserver

/**
 * Returns the root of the directory which contains security configuration files, if the
 * directory does exist it is created.
 *
 * <p>This directory is called 'security', and is located directly under {@link #root()}
 *
 * @deprecated As of GeoServer 2.6, replaced by @link {@link #getSecurity()}
 */
@Deprecated
public File findOrCreateSecurityRoot() throws IOException {
  return getSecurity().dir(); // will create directory as needed
}
origin: geoserver/geoserver

/**
 * Returns the directory in which a resources configuration is persisted, if the directory does
 * not exist it will be created.
 *
 * @deprecated As of GeoServer 2.6, replaced by {@link #get(ResourceInfo, String...)}
 */
public File findOrCreateResourceDir(ResourceInfo r) throws IOException {
  Resource directory = get(r);
  return directory.dir();
}
origin: geoserver/geoserver

/**
 * User/group configuration root directory.
 *
 * @deprecated Use {@link #userGroup()}
 */
public File getUserGroupRoot() throws IOException {
  return get("security/usergroup").dir();
}
origin: geoserver/geoserver

/**
 * Returns the root of the directory which contains spatial data files, if the directory does
 * not exist it will be created.
 *
 * <p>This directory is called 'data', and is located directly under {@link #root()}
 */
public File findOrCreateDataRoot() throws IOException {
  Resource directory = get("data");
  return directory.dir(); // will create directory as needed
}
origin: geoserver/geoserver

/**
 * Role configuration root directory.
 *
 * @deprecated Use {@link #role()}
 */
public File getRoleRoot() throws IOException {
  return get("security/role").dir();
}
origin: geoserver/geoserver

/**
 * Returns the directory for the specified workspace, if the directory does not exist it will be
 * created.
 *
 * @param create If set to true the directory will be created when it does not exist.
 * @deprecated As of GeoServer 2.6, replaced by {@link #get(WorkspaceInfo, String...)}
 */
@Deprecated
public File findOrCreateWorkspaceDir(WorkspaceInfo ws) throws IOException {
  Resource directory = get(ws);
  return directory.dir();
}
origin: geoserver/geoserver

/**
 * Master password provider root
 *
 * @deprecated Use {@link #masterPasswordProvider()}
 */
public File getMasterPasswordProviderRoot() throws IOException {
  return get("security/masterpw").dir();
}
origin: geoserver/geoserver

/**
 * Authentication configuration root directory.
 *
 * @deprecated use {@link #auth()}
 */
public File getAuthRoot() throws IOException {
  return get("security/auth").dir();
}
origin: geoserver/geoserver

/**
 * Security configuration root directory.
 *
 * @deprecated Use {@link #get(String)}}
 */
public File getSecurityRoot() throws IOException {
  return get("security").dir();
}
origin: geoserver/geoserver

/**
 * Returns the directory in which global styles are persisted, if the directory does not exist
 * it will be created.
 *
 * @deprecated As of GeoServer 2.6, replaced by {@link #get(StyleInfo, String...)}
 */
public File findOrCreateStyleDir() throws IOException {
  Resource styles = get(STYLE_DIR);
  return styles.dir();
}
origin: geoserver/geoserver

/**
 * Performs a directory lookup, creating the file if it does not exist.
 *
 * @param location The location of the directory to find or create.
 * @return The file handle.
 * @throws IOException If any i/o errors occur.
 */
public File findOrCreateDirectory(String location) throws IOException {
  Resource directory = get(Paths.convert(location));
  return directory.dir(); // will create directory as needed
}
origin: geoserver/geoserver

/**
 * Returns a directory under the {@link #root()} directory, if the directory does not exist it
 * will be created.
 *
 * @return directory (created if needed)
 */
public File findOrCreateDir(String... location) throws IOException {
  return get(Paths.path(location)).dir();
}
origin: geoserver/geoserver

/**
 * Performs a directory lookup, creating the file if it does not exist.
 *
 * @param location The components of the path that make up the location of the directory to find
 *     or create.
 */
public File findOrCreateDirectory(String... location) throws IOException {
  Resource directory = get(Paths.path(location));
  return directory.dir(); // will create directory as needed
}
origin: geoserver/geoserver

private void writeCurrentVersion() throws IOException {
  Resource security = security();
  security.dir();
  Resource properties = security.get(VERSION_PROPERTIES);
  Properties p = new Properties();
  p.put(VERSION, CURR_VERSION.toString());
  try (OutputStream os = properties.out()) {
    p.store(
        os,
        "Current version of the security directory. Do not remove or alter this file");
  }
}
origin: geoserver/geoserver

/**
 * Returns a directory under the {@link #dataRoot()} directory, if the directory does not exist
 * it will be created.
 */
public File findOrCreateDataDir(String... location) throws IOException {
  Resource resource = get(Paths.path("data", Paths.path(location)));
  return resource.dir();
}
origin: geoserver/geoserver

/**
 * Performs a directory lookup, creating the file if it does not exist.
 *
 * @param parentFile The containing directory, possibly null.
 * @param location The components of the path that make up the location of the directory to find
 *     or create.
 */
public File findOrCreateDirectory(File parentFile, String... location) throws IOException {
  Resource directory = get(Paths.convert(getBaseDirectory(), parentFile, location));
  return directory.dir(); // will create directory as needed
}
origin: geoserver/geoserver

/**
 * Performs a directory lookup, creating the file if it does not exist.
 *
 * @param parentFile The containing directory, may be null.
 * @param location The location of the directory to find or create.
 * @return The file handle.
 * @throws IOException If any i/o errors occur.
 */
public File findOrCreateDirectory(File parentFile, String location) throws IOException {
  Resource directory = get(Paths.convert(getBaseDirectory(), parentFile, location));
  return directory.dir(); // will create directory as needed
}
origin: geoserver/geoserver

  @Test
  public void testReloadWithRuinedCoverageStore() throws Exception {
    // ruin one coverage description
    File root = getDataDirectory().getRoot().dir();
    File targetCoverage = new File(root, "workspaces/wcs/BlueMarble/coveragestore.xml");
    FileUtils.writeStringToFile(targetCoverage, "boom!");

    // reload and check it does not go belly up
    getGeoServer().reload();

    // check the coverage in question is no more
    getCatalog().getCoverageByName(getLayerId(MockData.TASMANIA_BM));
  }
}
origin: geoserver/geoserver

@Test
public void testGetParamsFixesDatabaseFilePath() {
  Catalog catalog = getCatalog();
  ResourcePool pool = new ResourcePool(catalog);
  DataStoreInfo ds = getCatalog().getFactory().createDataStore();
  ds.getConnectionParameters().put("database", "file:data/test.gpkg");
  Map newParams = pool.getParams(ds.getConnectionParameters(), getResourceLoader());
  GeoServerDataDirectory dataDir = new GeoServerDataDirectory(getResourceLoader());
  String absolutePath = dataDir.get("data/test.gpkg").dir().getAbsolutePath();
  assertNotEquals(newParams.get("database"), "file:data/test.gpkg");
  assertTrue(((String) newParams.get("database")).contains(absolutePath));
}
org.geoserver.platform.resourceResourcedir

Javadoc

Directory access to resource contents.

Directory contents may need to be unpacked into the GeoServer data directory prior to use. Do not assume the file exists before calling this method.

Popular methods of Resource

  • out
  • getType
  • in
  • get
  • file
  • path
  • delete
  • name
  • list
  • lastmodified
  • parent
  • addListener
  • parent,
  • addListener,
  • renameTo,
  • getContents,
  • removeListener,
  • load,
  • lock,
  • save,
  • setContents

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Path (java.nio.file)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
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