Host directory to be mounted into container.<br/>
Please note that in boot2docker environments (OSX or Windows)
only locations inside $HOME can work (/Users or /c/Users respectively).

@param hostFileOrDir Directory or file to be mounted.
493164
public DockerRuleMountToBuilder mountFrom(File hostFileOrDir) throws InvalidVolumeFrom {
        if ( ! hostFileOrDir.exists()) {
            throw new InvalidVolumeFrom(String.format("mountFrom: %s does not exist", hostFileOrDir.getAbsolutePath()));
        }
        String hostDirUnixPath = DockerRuleMountBuilder.toUnixStylePath(hostFileOrDir.getAbsolutePath());
        return new DockerRuleMountBuilder(this, hostDirUnixPath);
    }
567343
def xoscmounts(host_mount):
    
    callback_lower_drive_letter = lambda pat: pat.group(1).lower()
    host_mount = re.sub(r"^([a-zA-Z])\:", callback_lower_drive_letter, host_mount)
    host_mount = re.sub(r"^([a-z])", "//\\1", host_mount)
    host_mount = re.sub(r"\\", "/", host_mount)
    return host_mount
273830
@Nonnull
  public CSP2SourceList addHost (@Nonnull @Nonempty final String sHost)
  {
    ValueEnforcer.notEmpty (sHost, "Host");
    m_aList.add (sHost);
    return this;
  }
360322
def __make_scubadir(self):
        '''
        '''
        self.__scubadir_hostpath = tempfile.mkdtemp(prefix='scubadir')
        self.__scubadir_contpath = '/.scuba'
        self.add_volume(self.__scubadir_hostpath, self.__scubadir_contpath)
234552
public void setIncludeRoot(File includeroot) {

        this.includeroot = includeroot;

        if (!includeroot.exists()) {
            throw new BuildException("includeroot doesn't exist: "
                    + includeroot);
        }
        if (!includeroot.isDirectory()) {
            throw new BuildException("includeroot must be a directory: "
                    + includeroot);
        }
    }
537833
public static Resource getHomeDirectory() {
	if (homeFile != null) return homeFile;

	ResourceProvider frp = ResourcesImpl.getFileResourceProvider();

	String homeStr = System.getProperty("user.home");
	if (homeStr != null) {
	    homeFile = frp.getResource(homeStr);
	    homeFile = ResourceUtil.getCanonicalResourceEL(homeFile);
	}
	return homeFile;
    }
1336731
def use_propsfs(self, folder=None, front=False):
        
        if folder is None:
            folder = "/%s/props" % ("Volumes" if platform.system().lower() == "darwin" else "mnt")
        self.add(PropsfsProvider(folder), front=front)
749931
def mount(name, device, mkmnt=False, fstype='', opts='defaults', user=None, util='mount'):
    '''
    
    '''
    if util != 'mount':
        # This functionality used to live in img.mount_image
        if util == 'guestfs':
            return __salt__['guestfs.mount'](name, root=device)
        elif util == 'qemu_nbd':
            mnt = __salt__['qemu_nbd.init'](name, device)
            if not mnt:
                return False
            first = next(six.iterkeys(mnt))
            __context__['img.mnt_{0}'.format(first)] = mnt
            return first
        return False

    # Darwin doesn't expect defaults when mounting without other options
    if 'defaults' in opts and __grains__['os'] in ['MacOS', 'Darwin', 'AIX']:
        opts = None

    if isinstance(opts, six.string_types):
        opts = opts.split(',')

    if not os.path.exists(name) and mkmnt:
        __salt__['file.mkdir'](name, user=user)

    args = ''
    if opts is not None:
        lopts = ','.join(opts)
        args = '-o {0}'.format(lopts)

    if fstype:
        # use of fstype on AIX differs from typical Linux use of -t
        # functionality AIX uses -v vfsname, -t fstype mounts all with
        # fstype in /etc/filesystems
        if 'AIX' in __grains__['os']:
            args += ' -v {0}'.format(fstype)
        elif 'solaris' in __grains__['os'].lower():
            args += ' -F {0}'.format(fstype)
        else:
            args += ' -t {0}'.format(fstype)

    cmd = 'mount {0} {1} {2} '.format(args, device, name)
    out = __salt__['cmd.run_all'](cmd, runas=user, python_shell=False)
    if out['retcode']:
        return out['stderr']
    return True
1286487
function(dir){
        dir = dir || _OS_HOSTS_DIR;
        var str = this._stringifyData(this._dataCache);
        fs.writeFileSync(dir, str, 'utf-8');
        return this;
    }
2309
public function setRootDir($rootDir)
    {
        if (!is_dir($rootDir)) {
            throw new \InvalidArgumentException(
                sprintf('Invalid Application Configuration Directory: %s', $rootDir)
            );
        }

        $this->rootDir = $rootDir;
    }
635701
public ContainerRequest setupContainerAskForRM(int containerMemory, int containerVirtualCores, int priority, String[] racks, String[] hosts) {
        Priority pri = Priority.newInstance(priority);
        Resource capability = Resource.newInstance(containerMemory,
                containerVirtualCores);
        ContainerRequest request = new ContainerRequest(capability, hosts, racks,
                pri, false);
        LOG.info("By Thrift Server Requested container  ask: " + request.toString());
        return request;
    }
148030
function setHost(uri) {
  if (uri.auth || uri.hostname || uri.port) {
    uri.host = '';
    if (uri.auth) uri.host += uri.auth + '@';
    if (uri.hostname) uri.host += uri.hostname;
    if (uri.port) uri.host += ':' + uri.port;
  }
}
1315556
protected function setRootDir(/*# string */ $rootDir)
    {
        // validate root directory
        if (!is_string($rootDir) || !is_dir($rootDir) || !is_readable($rootDir))
        {
            throw new InvalidArgumentException(
                Message::get(Message::CONFIG_DIR_INVALID, $rootDir),
                Message::CONFIG_DIR_INVALID
            );
        }
        $this->root_dir = rtrim($rootDir, '/\\');

        return $this;
    }
879238
void initialize(HostContext hostContext) throws InvalidKeyException, URISyntaxException, StorageException {
        this.hostContext = hostContext;

        if (this.storageContainerName == null) {
            this.storageContainerName = this.hostContext.getEventHubPath();
        }

        // Validate that the event hub name is also a legal storage container name.
        // Regex pattern is copied from .NET version. The syntax for Java regexes seems to be the same.
        // Error message is also copied from .NET version.
        Pattern p = Pattern.compile("^(?-i)(?:[a-z0-9]|(?<=[0-9a-z])-(?=[0-9a-z])){3,63}$");
        Matcher m = p.matcher(this.storageContainerName);
        if (!m.find()) {
            throw new IllegalArgumentException("EventHub names must conform to the following rules to be able to use it with EventProcessorHost: "
                    + "Must start with a letter or number, and can contain only letters, numbers, and the dash (-) character. "
                    + "Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names. "
                    + "All letters in a container name must be lowercase. "
                    + "Must be from 3 to 63 characters long.");
        }

        this.storageClient = CloudStorageAccount.parse(this.storageConnectionString).createCloudBlobClient();

        this.eventHubContainer = this.storageClient.getContainerReference(this.storageContainerName);

        // storageBlobPrefix is either empty or a real user-supplied string. Either way we can just
        // stick it on the front and get the desired result.
        this.consumerGroupDirectory = this.eventHubContainer.getDirectoryReference(this.storageBlobPrefix + this.hostContext.getConsumerGroupName());

        this.gson = new Gson();

        this.leaseOperationOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getLeaseDurationInSeconds() * 1000);
        this.storageClient.setDefaultRequestOptions(this.leaseOperationOptions);
        this.checkpointOperationOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getCheckpointTimeoutInSeconds() * 1000);
        // The only option that .NET sets on renewRequestOptions is ServerTimeout, which doesn't exist in Java equivalent.
        // Keep it separate in case we need to change something later.
        // Only used for leases, not checkpoints, so set max execution time to lease value
        this.renewRequestOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getLeaseDurationInSeconds() * 1000);
    }
1086856
private void setupHost(ListItemHostWidget host, Widget view, final int dataIndex) {
        boolean selected = setupView(view, dataIndex);
        host.setGuest(view, dataIndex);
        host.setSelected(selected);
        host.requestLayout();

        if (mContent.getChildren().contains(host)) {
            Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "setupItem(%s): added item(%s) at dataIndex [%d]",
                    getName(), view.getName(), dataIndex);
        } else {
            Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "setupItem(%s): reuse item(%s) at dataIndex [%d]",
                    getName(), view.getName(), dataIndex);
        }
    }
1092370
function HostEntry(addr, src) {
  if (!(this instanceof HostEntry))
    return new HostEntry(addr, src);

  this.addr = addr || new NetAddress();
  this.src = src || new NetAddress();
  this.prev = null;
  this.next = null;
  this.used = false;
  this.refCount = 0;
  this.attempts = 0;
  this.lastSuccess = 0;
  this.lastAttempt = 0;

  if (addr)
    this.fromOptions(addr, src);
}
40426
public static boolean init(JobHistoryObserver jobTracker, JobConf conf,
             String hostname, long jobTrackerStartTime){
    try {
      LOG_DIR = conf.get("hadoop.job.history.location" ,
        "file:///" + new File(
        System.getProperty("hadoop.log.dir", "/tmp")).getAbsolutePath()
        + File.separator + "history");
      JOBTRACKER_UNIQUE_STRING = hostname + "_" + 
                                    String.valueOf(jobTrackerStartTime) + "_";
      jobtrackerHostname = hostname;
      Path logDir = new Path(LOG_DIR);
      LOGDIR_FS = logDir.getFileSystem(conf);
      if (!LOGDIR_FS.exists(logDir)){
        if (!LOGDIR_FS.mkdirs(logDir, new FsPermission(HISTORY_DIR_PERMISSION))) {
          throw new IOException("Mkdirs failed to create " + logDir.toString());
        }
      }
      conf.set("hadoop.job.history.location", LOG_DIR);
      disableHistory = false;
      // set the job history block size (default is 3MB)
      jobHistoryBlockSize = 
        conf.getLong("mapred.jobtracker.job.history.block.size", 
                     3 * 1024 * 1024);
      jtConf = conf;

      // initialize the file manager
      fileManager = new JobHistoryFilesManager(conf, jobTracker, logDir);
    } catch(IOException e) {
        LOG.error("Failed to initialize JobHistory log file", e); 
        disableHistory = true;
    }
    fileManager.startIOExecutor();
    return !(disableHistory);
  }