This method checks to see if symlinks are to be create for the
localized cache files in the current working directory
@param conf the jobconf
@return true if symlinks are to be created- else return false
489465
public static boolean getSymlink(Configuration conf){
    String result = conf.get("mapred.create.symlink");
    if ("yes".equals(result)){
      return true;
    }
    return false;
  }
1048050
def symlink(parser, cmd, args):
    

    parser.add_argument(
        'apps',
        nargs=argparse.REMAINDER,
        help='Which apps to create symlinks for.'
    )
    args = parser.parse_args(args)

    base_dir, pwny_main = os.path.split(sys.argv[0])

    for app_name, config in MAIN_FUNCTIONS.items():
        if not config['symlink'] or (args.apps and app_name not in args.apps):
            continue
        dest = os.path.join(base_dir, app_name)
        if not os.path.exists(dest):
            print('Creating symlink %s' % dest)
            os.symlink(pwny_main, dest)
        else:
            print('Not creating symlink %s (file already exists)' % dest)
986358
@Override
	protected boolean isCacheValid() {
		return super.isCacheValid()
				&& StringUtils.equals(cacheProperties.getProperty(JAWR_LOCALE_GENERATOR_FALLBACK_TO_SYSTEM_LOCALE),
						config.getProperty(JAWR_LOCALE_GENERATOR_FALLBACK_TO_SYSTEM_LOCALE,
								Boolean.toString(DEFAULT_FALLBACK_TO_SYSTEM_LOCALE)))
				&& StringUtils.equals(cacheProperties.getProperty(JAWR_LOCALE_GENERATOR_RESOURCE_BUNDLE_CHARSET),
						config.getProperty(JAWR_LOCALE_GENERATOR_RESOURCE_BUNDLE_CHARSET,
								DEFAULT_RESOURCE_BUNDLE_CHARSET))
				&& StringUtils.equals(cacheProperties.getProperty(JAWR_LOCALE_GENERATOR_ADD_QUOTE_TO_MSG_KEY),
						config.getProperty(JAWR_LOCALE_GENERATOR_ADD_QUOTE_TO_MSG_KEY,
								Boolean.toString(DEFAULT_VALUE_ADD_QUOTE_TO_MSG_KEY)));
	}
680924
function createSymlinks(symlinks) {
    let path = require('path');
    let fs = require('fs');
    let del = require('del');

    del.sync(symlinks.map(sl => sl.dest));
    try {
        symlinks.forEach(sl => {
            let src = path.resolve(sl.src);
            fs.symlinkSync(src, sl.dest);
        });
    } catch (err) {
        console.error(err);
        if (err.code === 'EPERM' && err.errno === -4048) {
            console.error('***************************');
            console.error('*** PLEASE RUN AS ADMIN ***');
            console.error('***************************');
        }
    }
}
1262451
public static void markSuccessfulOutputDir(Path path, JobConf conf) throws IOException {
        FileSystem fs = FileSystem.get(conf);
        // create a file in the folder to mark it
        if (fs.exists(path)) {
            Path filePath = new Path(path, VersionedStore.HADOOP_SUCCESS_FLAG);
            fs.create(filePath).close();
        }
    }
762530
function initializeKVPersistent (config) {
	/* NB Makes FS syscalls each time in case config changes during lifetime.
	 * Could cache the set of initialized dirs if this is a performance issue. */

	/* First try a mkdir. Dir might exist already. */
	try {
		fs.mkdirSync(config.cache.persistentDir);
	} catch (e) {
	}

	/* If we have a dir now, we're happy.
	 * This also works if persistentDir is a symlink. */
	try {
		const stats = fs.lstatSync(config.cache.persistentDir);
		if (stats.isDirectory()) {
			return true;
		} else {
			return false;
		}
	} catch (e) {
		/* Hmm. */
		return false;
	}
}
587284
public static boolean contains(Configuration jobConf, String name) {
		if (StringUtils.isNotBlank(jobConf.get(name))) {
			return true;
		} else {
			return false;
		}
	}
560790
protected boolean createDirectoryIfNotExists(Path path) throws IOException {
        if(!Files.exists(path)) {
            Files.createDirectories(path);
            return true;
        }
        else {
            return false;
        }
    }
1198316
public static LocalFileSystem getLocal(Configuration conf)
    throws IOException {
    return (LocalFileSystem)get(LocalFileSystem.NAME, conf);
  }
1047005
def create_symlink(from, to)
      if Origen.running_on_windows?
        system("call mklink /D #{to.to_s.gsub('/', '\\')} #{from.to_s.gsub('/', '\\')}")
        File.new("#{to}_is_a_symlink", 'w') {}
      else
        FileUtils.symlink from, to
      end
    end
237992
public boolean isDirectory() {
        if (this.file != null) {
            return this.file.isDirectory();
        }

        if (this.header != null) {
            if (this.header.linkFlag == TarHeader.LF_DIR) {
                return true;
            }

            if (this.header.name.toString().endsWith("/")) {
                return true;
            }
        }

        return false;
    }
818429
Path[] getLocalFiles(JobConf conf, String subdir) throws IOException{
    String[] localDirs = getLocalDirsFromConf(conf);
    Path[] paths = new Path[localDirs.length];
    FileSystem localFs = FileSystem.getLocal(conf);
    for (int i = 0; i < localDirs.length; i++) {
      paths[i] = new Path(localDirs[i], subdir);
      paths[i] = paths[i].makeQualified(localFs);
    }
    return paths;
  }
939326
private static Path locateFileInCache(Configuration conf, String filename) throws IOException {
    return new Path(getInstancesFolder(FileSystem.get(conf), conf), filename);
  }
945501
public boolean ifExists(String pathStr,Configuration conf) {
    AllocatorPerContext context = obtainContext(contextCfgItemName);
    return context.ifExists(pathStr, conf);
  }
758149
private function doSymLinks()
    {
        if(config('deploy.symlinks')) {

            $this->comment("\n\nCreating symlinks");
            foreach(config('deploy.symlinks') as $target => $link){
                if (file_exists($link)) {
                    $this->comment('The '.$link.' directory already exists.');
                }else{
                    $this->laravel->make('files')->link(
                        $target, $link
                    );
                }
            }

            $this->info("Symlinks created");
        }

        return $this;
    }
49003
public static void addCacheFile(URI uri, Configuration conf) {
    String files = conf.get("mapred.cache.files");
    conf.set("mapred.cache.files", files == null ? uri.toString() : files + ","
             + uri.toString());
  }
1136356
public boolean hasDataSourceConfiguration(final String shardingSchemaName) {
        return !Strings.isNullOrEmpty(regCenter.get(configNode.getDataSourcePath(shardingSchemaName)));
    }