Add pex_bootstrapper.bootstrap_pex_env() for simplified external pex bootstrapping.
In jar-tool, use apache commons FileUtils.moveFile to use copy when target of jar write is across filesystem boundary

This change updates File.rename() to use the apache commons FileUtils.moveFile() when writing out a jar file in JarBuilder.write().  This change uses a simple file rename when possible, or a copy if the two files can't be renamed (if the destination is on a different filesystem, for example.)

Testing Done:
Ran ./pants goal test tests/java/com/twitter/common/jar/tool

It would be great if Patrick could test out in their environment where this is a problem:

1.) in twitter/commons use `./pants goal binary --binary-deployjar src/java/com/twitter/common/jar/tool/:main` to produce a self-contained tool jar at dist/jar-tool.jar
2.) in pantsbuild/pants edit like so adapted for your local paths:
$ git diff
diff --git a/BUILD.tools b/BUILD.tools
index 0e39737..0562831 100644
--- a/BUILD.tools
+++ b/BUILD.tools
@@ -95,6 +95,7 @@ jar_library(name = 'scrooge-legacy-gen',

 jar_library(name = 'jar-tool',
             jars = [
-              jar(org = 'com.twitter.common', name = 'jar-tool', rev = '0.1.5')
+              jar(org = 'com.twitter.common', name = 'jar-tool', rev = '0.1.6-SNAPSHOT',
+                  mutable=True, url="file:///home/<your path here>/commons/dist/jar-tool.jar")
             ])

Bugs closed: 295

Reviewed at https://rbcommons.com/s/twitter/r/440/
In jar-tool, use apache commons FileUtils.moveFile to use copy when target of jar write is across filesystem boundary

This change updates File.rename() to use the apache commons FileUtils.moveFile() when writing out a jar file in JarBuilder.write().  This change uses a simple file rename when possible, or a copy if the two files can't be renamed (if the destination is on a different filesystem, for example.)

Testing Done:
Ran ./pants goal test tests/java/com/twitter/common/jar/tool

Bugs closed: 295

Reviewed at https://rbcommons.com/s/twitter/r/440/

Signed-off-by: John Sirois <jsirois@twitter.com>

RB_ID=376301
Close the open files before trying to move them
Merge pull request #298 from ericzundel/zundel/fix-corrupt-across-filesystems

Close the open files before trying to move them