congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ca.carleton.gcrc.utils
Code IndexAdd Tabnine to your IDE (free)

How to use ca.carleton.gcrc.utils

Best Java code snippets using ca.carleton.gcrc.utils (Showing top 11 results out of 315)

origin: ca.carleton.gcrc/nunaliit2-utils

/**
 * Given a directory, returns a set of strings which are the paths to all elements
 * within the directory. This process recurses through all sub-directories.
 * @param dir The directory to be traversed
 * @param includeDirectories If set, the name of the paths to directories are included
 * in the result.
 * @return A set of paths to all elements in the given directory
 */
static public Set<String> getDescendantPathNames(File dir, boolean includeDirectories) {
  Set<String> paths = new HashSet<String>();
  if( dir.exists() && dir.isDirectory() ) {
    String[] names = dir.list();
    for(String name : names){
      File child = new File(dir,name);
      getPathNames(child, paths, null, includeDirectories);
    }
  }
  return paths;
}
origin: ca.carleton.gcrc/nunaliit2-utils

  /**
   * Given a directory, removes all the content found in the directory.
   * @param dir The directory to be emptied
   * @throws Exception
   */
  static public void emptyDirectory(File dir) throws Exception {
    String[] fileNames = dir.list();
    if( null != fileNames ) {
      for(String fileName : fileNames){
        File file = new File(dir,fileName);
        if( file.isDirectory() ) {
          emptyDirectory(file);
        }
        boolean deleted = false;
        try {
          deleted = file.delete();
        } catch(Exception e) {
          throw new Exception("Unable to delete: "+file.getAbsolutePath(),e);
        }
        if( !deleted ){
          throw new Exception("Unable to delete: "+file.getAbsolutePath());
        }
      }
    }
  }
}
origin: ca.carleton.gcrc/nunaliit2-utils

String val = (String)valObj;
key = saveConvert(key, true);
val = saveConvert(val, false);
bw.write(key + "=" + val);
bw.newLine();
origin: ca.carleton.gcrc/nunaliit2-couch-command

fos = new FileOutputStream(installPropFile);
OutputStreamWriter osw = new OutputStreamWriter(fos,"UTF-8");
PropertiesWriter propWriter = new PropertiesWriter(osw);
propWriter.write(publicProps);
fos = new FileOutputStream(sensitivePropFile);
OutputStreamWriter osw = new OutputStreamWriter(fos,"UTF-8");
PropertiesWriter propWriter = new PropertiesWriter(osw);
propWriter.write(sensitiveProps);
origin: ca.carleton.gcrc/nunaliit2-couch-client

File child = new File(currentParent, name);
if( false == child.exists() ){
  Files.createDirectory(child);
} else if( false == child.isDirectory() ) {
  throw new Exception("Attachment path is not a directory: "+child.getAbsolutePath());
origin: ca.carleton.gcrc/nunaliit2-utils

File childTarget = new File(target,childName);
copy(childSource,childTarget);
origin: ca.carleton.gcrc/nunaliit2-couch-client

Files.emptyDirectory(child);
origin: ca.carleton.gcrc/nunaliit2-couch-client

Files.createDirectory(dumpDir);
origin: ca.carleton.gcrc/nunaliit2-utils

static private void getPathNames(File dir, Set<String> paths, String prefix, boolean includeDirectories) {
  if( dir.exists() ) {
    if( dir.isFile() ){
      String path = dir.getName();
      if( null != prefix ) {
        path = prefix + File.pathSeparator + dir.getName();
      }
      paths.add(path);
      
    } else if( dir.isDirectory() ) {
      String dirPath = dir.getName();
      if( null != prefix ) {
        dirPath = prefix + File.pathSeparator + dir.getName();
      }
      
      if( includeDirectories ){
        paths.add(dirPath);
      }
      
      // Children
      String[] names = dir.list();
      for(String name : names){
        File child = new File(dir,name);
        getPathNames(child, paths, dirPath, includeDirectories);
      }
    }
  }
}
origin: ca.carleton.gcrc/nunaliit2-couch-client

Files.emptyDirectory(child);
origin: ca.carleton.gcrc/nunaliit2-couch-client

Files.createDirectory(attachmentDir);
ca.carleton.gcrc.utils

Most used classes

  • Files
  • PropertiesWriter
    Instances of this class can be used to store properties found in an instance of Properties to a writ
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