Github user aarondav commented on a diff in the pull request:
https://github.com/apache/spark/pull/914#discussion_r13262410
--- Diff:
core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala ---
@@ -381,16 +381,19 @@ private[spark] class SparkSubmitArguments(args:
Seq[String]) {
object SparkSubmitArguments {
/** Load properties present in the given file. */
def getPropertiesFromFile(file: File): Seq[(String, String)] = {
- require(file.exists(), s"Properties file ${file.getName} does not
exist")
+ require(file.exists(), s"Properties file $file does not exist")
+ require(file.isFile(), s"Properties file $file is not a normal file")
--- End diff --
`File.isFile()` returns `true` for symlinks which point to files.
```
$ touch testfile
$ ln -s testfile testlink
$ scala
scala> new java.io.File("testlink").isFile()
res0: Boolean = true
```
Additionally, since the docs aren't 100% clear and I couldn't find a solid
answer from Google, I checked both the
[UnixFileSystem](http://code.metager.de/source/xref/openjdk/jdk8/jdk/src/solaris/native/java/io/UnixFileSystem_md.c#111)
and
[WindowsFileSystem](http://code.metager.de/source/xref/openjdk/jdk6/jdk/src/windows/native/java/io/Win32FileSystem_md.c#150).
The former uses `stat` which resolves symbolic links. The latter will set
isFile to true if and only if it is not a directory, so symlinks would be
included.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---