Extract builds with .dmg extension

        Will only work if `hdiutil` is available.

        @type path:
        @param path:
14371
def extract_dmg(self, path='.'):
        
        dmg_fd, dmg_fn = tempfile.mkstemp(prefix='fuzzfetch-', suffix='.dmg')
        os.close(dmg_fd)
        out_tmp = tempfile.mkdtemp(prefix='fuzzfetch-', suffix='.tmp')
        try:
            _download_url(self.artifact_url('dmg'), dmg_fn)
            if std_platform.system() == 'Darwin':
                LOG.info('.. extracting')
                subprocess.check_call(['hdiutil', 'attach', '-quiet', '-mountpoint', out_tmp, dmg_fn])
                try:
                    apps = [mt for mt in os.listdir(out_tmp) if mt.endswith('app')]
                    assert len(apps) == 1
                    shutil.copytree(os.path.join(out_tmp, apps[0]), os.path.join(path, apps[0]), symlinks=True)
                finally:
                    subprocess.check_call(['hdiutil', 'detach', '-quiet', out_tmp])
            else:
                LOG.warning('.. can\'t extract target.dmg on %s', std_platform.system())
                shutil.copy(dmg_fn, os.path.join(path, 'target.dmg'))
        finally:
            shutil.rmtree(out_tmp, onerror=onerror)
            os.unlink(dmg_fn)
1003108
def get_version_exec_mapping_from_path(path):
    
    version_executable = {}
    logger.debug('Getting exes from path: {}'.format(path))

    for sub_dir in path.iterdir():
        if not sub_dir.name.startswith(APPLICATION_NAME):
            continue

        release = sub_dir.name.split(APPLICATION_NAME)[-1]
        executable = Path(sub_dir, 'bin').glob('maya.exe').next()
        version_executable[release] = str(executable)
    logger.debug('Found exes for: {}'.format(version_executable.keys()))
    return version_executable
442856
public static HttpFileBuilder ofResource(String path) {
        requireNonNull(path, "path");
        return ofResource(HttpFile.class.getClassLoader(), path);
    }
891635
def run(self, path=None):
        
        if path is None:
            path = '.'

        for prop in self._properties.values():
            if not prop.prompt():
                return False

        return self.build(path)
794525
def cd(path, on=os):
    
    
    original = on.getcwd()
    on.chdir(path)
    
    yield
    
    on.chdir(original)
273753
public static Properties loadClasspath(String path) throws IOException {
		InputStream input = PropUtils.class.getClassLoader().getResourceAsStream(path);
		Properties prop = null;
		try {
			prop = load(input);
		} finally {
			IOUtils.close(input);
		}
		return prop;
	}
357193
def _parse_path(self, path):
        """"""
        # Support specifying another host via hdfs://host:port/path syntax
        # We ignore the scheme and piece together the query and fragment
        # Note that HDFS URIs are not URL encoded, so a '?' or a '#' in the URI is part of the
        # path
        parts = urlsplit(path, allow_fragments=False)
        if not parts.path.startswith('/'):
            raise ValueError("Path must be absolute, was given {}".format(path))
        if parts.scheme not in ('', 'hdfs', 'hftp', 'webhdfs'):
            warnings.warn("Unexpected scheme {}".format(parts.scheme))
        assert not parts.fragment
        path = parts.path
        if parts.query:
            path += '?' + parts.query
        if parts.netloc:
            hosts = self._parse_hosts(parts.netloc)
        else:
            hosts = self.hosts
        return hosts, path
1112191
def extract_path_ext(path, default_ext=None):
    
    ext = None
    _, dotext = os.path.splitext(path)
    if dotext:
        ext = dotext[1:]
    if not ext and default_ext:
        ext = default_ext
    if not ext:
        raise ValueError('No extension in path {} and default_ext is None'.format(path))
    return ext
1089057
public T extractFromPayload(String path, String variable) {
        if (JsonPathMessageValidationContext.isJsonPathExpression(path)) {
            getJsonPathVariableExtractor().getJsonPathExpressions().put(path, variable);
        } else {
            getXpathVariableExtractor().getXpathExpressions().put(path, variable);
        }
        return self;
    }
471644
def extract_tar(self, suffix, path='.'):
        
        mode = suffix.split('.')[-1]
        tar_fd, tar_fn = tempfile.mkstemp(prefix='fuzzfetch-', suffix='.tar.%s' % mode)
        os.close(tar_fd)
        try:
            _download_url(self.artifact_url(suffix), tar_fn)
            LOG.info('.. extracting')
            with tarfile.open(tar_fn, mode='r:%s' % mode) as tar:
                members = []
                for member in tar.getmembers():
                    if member.path.startswith("firefox/"):
                        member.path = member.path[8:]
                        members.append(member)
                    elif member.path != "firefox":
                        # Ignore top-level build directory
                        members.append(member)
                tar.extractall(members=members, path=path)
        finally:
            os.unlink(tar_fn)
969756
function(buildPath, manifest) {
    fs.stat(manifest, function(err, stat) {
        if (! err) {
            manifest = JSON.parse(fs.readFileSync(manifest));

            for (var key in manifest) {
                del.sync(buildPath + '/' + manifest[key], { force: true });
            }
        }
    });
}
304233
private static InputStream getResourceAsStream(String path) throws IOException {
    if (StringUtils.isEmpty(path)) {
      return null;
    }

    // first try to load as file
    File file = new File(path);
    if (file.exists() && file.isFile()) {
      return new FileInputStream(file);
    }

    // if not a file fallback to classloader resource
    return CertificateLoader.class.getResourceAsStream(path);
  }
170122
public static Optional<String> getFilePathExtensionAsOpt(Path path) {
		return JMOptional
				.getNullableAndFilteredOptional(path, RegularFileFilter)
				.map(JMPath::getLastName).map(JMString::getExtension)
				.filter(getIsEmpty().negate());
	}
981843
def _install_from_path(path):
    '''
    
    '''
    if not os.path.exists(path):
        msg = 'File not found: {0}'.format(path)
        raise SaltInvocationError(msg)

    cmd = 'installer -pkg "{0}" -target /'.format(path)
    return salt.utils.mac_utils.execute_return_success(cmd)
989444
def CheckDirectory(self, path, extension='yaml'):
    
    result = True

    if extension:
      glob_spec = os.path.join(path, '*.{0:s}'.format(extension))
    else:
      glob_spec = os.path.join(path, '*')

    for definition_file in sorted(glob.glob(glob_spec)):
      if not self.CheckFile(definition_file):
        result = False

    return result
1181756
public static String[] extractBinaryResourceInfo(String path) {

		String[] resourceInfo = new String[2];
		String resourcePath = path;
		if (resourcePath.startsWith(JawrConstant.URL_SEPARATOR)) {
			resourcePath = resourcePath.substring(1);
		}

		Matcher matcher = CACHE_BUSTER_PATTERN.matcher(resourcePath);
		StringBuffer result = new StringBuffer();
		if (matcher.find()) {
			matcher.appendReplacement(result,
					StringUtils.isEmpty(matcher.group(GENERATED_BINARY_WEB_RESOURCE_PREFIX_INDEX))
							? CACHE_BUSTER_STANDARD_BINARY_WEB_RESOURCE_REPLACE_PATTERN
							: CACHE_BUSTER_GENERATED_BINARY_WEB_RESOURCE_REPLACE_PATTERN);
			resourceInfo[0] = result.toString();
			resourceInfo[1] = matcher.group(1);
		} else {
			resourceInfo[0] = path;
		}

		return resourceInfo;
	}
874266
public static List<Win32FindData> listDir(String path) {
    final List<Win32FindData> results = new ArrayList<Win32FindData>();
    listDirectory(path, new INativeWin32APICallback() {
      @Override
      public void handleFile(String name, int attributes, long createTime, long lastAccessTime, long lastModifiedTime, long length) {
        if (!(name.equals(".") || name.equals(".."))) {
          results.add(new Win32FindData(attributes, createTime, lastAccessTime, lastModifiedTime, length, name));
        }
      }
    });
    return results;
  }