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

How to use
Resource
in
org.avaje.classpath.scanner

Best Java code snippets using org.avaje.classpath.scanner.Resource (Showing top 10 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: org.avaje/avaje-dbmigration

/**
 * Return the content for the migration apply ddl script.
 */
public String getContent() {
 return resource.loadAsString("UTF-8");
}
origin: ebean-orm/ebean

 /**
  * Read the deployment XML for the given resources.
  */
 public static List<XmEbean> readByResourceList(List<Resource> resourceList){
  try {
   List<XmEbean> mappings = new ArrayList<>();
   for (Resource xmlMappingRes : resourceList) {
    try (InputStream is = new FileInputStream(xmlMappingRes.getLocationOnDisk())) {
     mappings.add(XmlMappingReader.read(is));
    }
   }
   return mappings;
  } catch (IOException e) {
   throw new RuntimeException("Error reading ebean xml mapping", e);
  }
 }
}
origin: org.avaje/avaje-dbmigration

/**
 * Read all the migration resources (SQL scripts) returning true if there are versions.
 */
public boolean readResources() {
 String migrationPath = migrationConfig.getMigrationPath();
 ClassLoader classLoader = migrationConfig.getClassLoader();
 Scanner scanner = new Scanner(classLoader);
 List<Resource> resourceList = scanner.scanForResources(migrationPath, new Match(migrationConfig));
 logger.debug("resources: {}", resourceList);
 for (Resource resource : resourceList) {
  String filename = resource.getFilename();
  if (filename.endsWith(migrationConfig.getApplySuffix())) {
   int pos = filename.lastIndexOf(migrationConfig.getApplySuffix());
   String mainName = filename.substring(0, pos);
   MigrationVersion migrationVersion = MigrationVersion.parse(mainName);
   LocalMigrationResource res = new LocalMigrationResource(migrationVersion, resource.getLocation(), resource);
   versions.add(res);
  }
 }
 Collections.sort(versions);
 return !versions.isEmpty();
}
origin: io.ebean/ebean-migration

/**
 * Return a programmatic JDBC migration.
 */
private LocalMigrationResource createJdbcMigration(Resource resource, String filename) {
 int pos = filename.lastIndexOf(".class");
 String mainName = filename.substring(0, pos);
 MigrationVersion migrationVersion = MigrationVersion.parse(mainName);
 String className = resource.getLocation().replace('/', '.');
 className = className.substring(0, className.length()-6);
 JdbcMigration instance = migrationConfig.getJdbcMigrationFactory().createInstance(className);
 return new LocalJdbcMigrationResource(migrationVersion, resource.getLocation(), instance);
}
origin: io.ebean/ebean-migration

private boolean readResourcesForPath(String path) {
 ClassLoader classLoader = migrationConfig.getClassLoader();
 Scanner scanner = new Scanner(classLoader);
 List<Resource> resourceList = scanner.scanForResources(path, new Match(migrationConfig));
 logger.debug("resources: {}", resourceList);
 for (Resource resource : resourceList) {
  String filename = resource.getFilename();
  if (filename.endsWith(migrationConfig.getApplySuffix())) {
   versions.add(createScriptMigration(resource, filename));
  } else if (migrationConfig.getJdbcMigrationFactory() != null && filename.endsWith(".class")) {
   versions.add(createJdbcMigration(resource, filename));
  }
 }
 Collections.sort(versions);
 return !versions.isEmpty();
}
origin: io.ebean/ebean-dbmigration

/**
 * Read all the migration resources (SQL scripts) returning true if there are versions.
 */
public boolean readResources() {
 String migrationPath = migrationConfig.getMigrationPath();
 ClassLoader classLoader = migrationConfig.getClassLoader();
 Scanner scanner = new Scanner(classLoader);
 List<Resource> resourceList = scanner.scanForResources(migrationPath, new Match(migrationConfig));
 logger.debug("resources: {}", resourceList);
 for (Resource resource : resourceList) {
  String filename = resource.getFilename();
  if (filename.endsWith(migrationConfig.getApplySuffix())) {
   int pos = filename.lastIndexOf(migrationConfig.getApplySuffix());
   String mainName = filename.substring(0, pos);
   MigrationVersion migrationVersion = MigrationVersion.parse(mainName);
   LocalMigrationResource res = new LocalMigrationResource(migrationVersion, resource.getLocation(), resource);
   versions.add(res);
  }
 }
 Collections.sort(versions);
 return !versions.isEmpty();
}
origin: io.ebean/ebean-migration

/**
 * Create a script based migration.
 */
private LocalMigrationResource createScriptMigration(Resource resource, String filename) {
 int pos = filename.lastIndexOf(migrationConfig.getApplySuffix());
 String mainName = filename.substring(0, pos);
 MigrationVersion migrationVersion = MigrationVersion.parse(mainName);
 return new LocalDdlMigrationResource(migrationVersion, resource.getLocation(), resource);
}
origin: io.ebean/ebean-migration

/**
 * Return the content for the migration apply ddl script.
 */
public String getContent() {
 return resource.loadAsString("UTF-8");
}
origin: io.ebean/ebean

 /**
  * Read the deployment XML for the given resources.
  */
 public static List<XmEbean> readByResourceList(List<Resource> resourceList){
  try {
   List<XmEbean> mappings = new ArrayList<>();
   for (Resource xmlMappingRes : resourceList) {
    try (InputStream is = new FileInputStream(xmlMappingRes.getLocationOnDisk())) {
     mappings.add(XmlMappingReader.read(is));
    }
   }
   return mappings;
  } catch (IOException e) {
   throw new RuntimeException("Error reading ebean xml mapping", e);
  }
 }
}
origin: io.ebean/ebean-dbmigration

/**
 * Return the content for the migration apply ddl script.
 */
public String getContent() {
 return resource.loadAsString("UTF-8");
}
org.avaje.classpath.scannerResource

Javadoc

A loadable resource.

Most used methods

  • getFilename
    Return the filename of this resource, without the path.
  • getLocation
    Return the location of the resource on the classpath (path and filename).
  • loadAsString
    Return the content of this resource as a string.
  • getLocationOnDisk
    Return the location of this resource on disk.

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JButton (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
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