please look at AbstractApplicationMaster.onContainersAllocated 
Path randomProducerJar = new Path(
			System.getenv("HADOOP_PREFIX") + "lib.zip");
		FileStatus jarStat = null;
		try {
		    FileSystem fs = FileSystem.get(conf);
		    randomProducerJar = fs.makeQualified(randomProducerJar);
		    jarStat = fs.getFileStatus(randomProducerJar);

		} catch (IOException e) {
		    // ToDO: Handle Exception
		    System.out.println(e.getMessage());
		}

		LocalResource randomProducerResource = Records
			.newRecord(LocalResource.class);
		randomProducerResource.setResource(ConverterUtils
			.getYarnUrlFromPath(randomProducerJar));
		randomProducerResource.setSize(jarStat.getLen());
		randomProducerResource.setTimestamp(jarStat
			.getModificationTime());
		randomProducerResource.setType(LocalResourceType.ARCHIVE);
		randomProducerResource
			.setVisibility(LocalResourceVisibility.PUBLIC);