Skip to content
Snippets Groups Projects
Commit b2634d7a authored by cramakri's avatar cramakri
Browse files

LMS-1503 Better error reporting in client.

SVN: 16256
parent efedf84b
No related branches found
No related tags found
No related merge requests found
......@@ -149,7 +149,6 @@ class PutDataSetExecutor
private OutputStream getOutputStream(FileInfoDssDTO fileInfo)
{
File file = new File(dataSetDir, fileInfo.getPathInDataSet());
System.out.println(file);
FileOutputStream fos;
try
......
......@@ -64,6 +64,11 @@ class CommandPut extends AbstractCommand
return getArguments().get(3);
}
public File getFile()
{
return new File(getFilePath());
}
@Override
public boolean isComplete()
{
......@@ -104,7 +109,17 @@ class CommandPut extends AbstractCommand
NewDataSetDTO newDataSet = getNewDataSet();
if (newDataSet.getFileInfos().isEmpty())
{
System.err.println("Data set file does not exist");
File file = arguments.getFile();
if (false == file.exists())
{
System.err.println("Data set file does not exist");
} else if (false == file.isDirectory())
{
System.err.println("Must select a directory to upload.");
} else
{
System.err.println("Data set is empty.");
}
return -1;
}
ConcatenatedFileInputStream fileInputStream =
......@@ -142,6 +157,10 @@ class CommandPut extends AbstractCommand
{
return fileInfos;
}
if (false == file.isDirectory())
{
return fileInfos;
}
FileInfoDssBuilder builder = new FileInfoDssBuilder(path, path);
builder.appendFileInfosForFile(file, fileInfos, true);
return fileInfos;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment