Tabnine Logo
Resource.dir
Code IndexAdd Tabnine 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)

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 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 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

/**
 * 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

/**
 * Role configuration root directory.
 *
 * @deprecated Use {@link #role()}
 */
public File getRoleRoot() throws IOException {
  return get("security/role").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 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

/**
 * Authentication configuration root directory.
 *
 * @deprecated use {@link #auth()}
 */
public File getAuthRoot() throws IOException {
  return get("security/auth").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

/**
 * 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

/**
 * Security configuration root directory.
 *
 * @deprecated Use {@link #get(String)}}
 */
public File getSecurityRoot() throws IOException {
  return get("security").dir();
}
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 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

/**
 * 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

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • CodeWhisperer 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