driver/java: use filepath.Join instead of simple +

This commit is contained in:
Clint Shryock 2015-09-03 10:25:09 -05:00
parent 256d5c1286
commit 8c6128503f

View file

@ -9,6 +9,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path" "path"
"path/filepath"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@ -100,8 +101,8 @@ func (d *JavaDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle,
return nil, fmt.Errorf("Error downloading source for Java driver: %s", err) return nil, fmt.Errorf("Error downloading source for Java driver: %s", err)
} }
base := path.Base(source) fPath := filepath.Join(ctx.AllocDir, path.Base(source))
f, err := os.OpenFile(ctx.AllocDir+base, os.O_CREATE|os.O_WRONLY, 0666) f, err := os.OpenFile(fPath, os.O_CREATE|os.O_WRONLY, 0666)
if err != nil { if err != nil {
return nil, fmt.Errorf("Error opening file to download too: %s", err) return nil, fmt.Errorf("Error opening file to download too: %s", err)
} }