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 ...@@ -149,7 +149,6 @@ class PutDataSetExecutor
private OutputStream getOutputStream(FileInfoDssDTO fileInfo) private OutputStream getOutputStream(FileInfoDssDTO fileInfo)
{ {
File file = new File(dataSetDir, fileInfo.getPathInDataSet()); File file = new File(dataSetDir, fileInfo.getPathInDataSet());
System.out.println(file);
FileOutputStream fos; FileOutputStream fos;
try try
......
...@@ -64,6 +64,11 @@ class CommandPut extends AbstractCommand ...@@ -64,6 +64,11 @@ class CommandPut extends AbstractCommand
return getArguments().get(3); return getArguments().get(3);
} }
public File getFile()
{
return new File(getFilePath());
}
@Override @Override
public boolean isComplete() public boolean isComplete()
{ {
...@@ -104,7 +109,17 @@ class CommandPut extends AbstractCommand ...@@ -104,7 +109,17 @@ class CommandPut extends AbstractCommand
NewDataSetDTO newDataSet = getNewDataSet(); NewDataSetDTO newDataSet = getNewDataSet();
if (newDataSet.getFileInfos().isEmpty()) 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; return -1;
} }
ConcatenatedFileInputStream fileInputStream = ConcatenatedFileInputStream fileInputStream =
...@@ -142,6 +157,10 @@ class CommandPut extends AbstractCommand ...@@ -142,6 +157,10 @@ class CommandPut extends AbstractCommand
{ {
return fileInfos; return fileInfos;
} }
if (false == file.isDirectory())
{
return fileInfos;
}
FileInfoDssBuilder builder = new FileInfoDssBuilder(path, path); FileInfoDssBuilder builder = new FileInfoDssBuilder(path, path);
builder.appendFileInfosForFile(file, fileInfos, true); builder.appendFileInfosForFile(file, fileInfos, true);
return fileInfos; 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