Author: tolusha
Date: 2011-12-07 02:29:23 -0500 (Wed, 07 Dec 2011)
New Revision: 5272
Modified:
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java
Log:
EXOJCR-848: IndexOutOfBoundsException on server side while trying to use FTP through
browser
Modified:
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java
===================================================================
---
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java 2011-12-06
13:40:35 UTC (rev 5271)
+++
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java 2011-12-07
07:29:23 UTC (rev 5272)
@@ -154,13 +154,20 @@
ArrayList<String> newPath = clientSession().getFullPath(resName);
try
{
- String repoPath = clientSession().getRepoPath(newPath);
- Session curSession = clientSession().getSession(newPath.get(0));
+ if (!newPath.isEmpty())
+ {
+ String repoPath = clientSession().getRepoPath(newPath);
+ Session curSession = clientSession().getSession(newPath.get(0));
- Node parentNode = (Node)curSession.getItem(repoPath);
- if (parentNode.isNodeType(FtpConst.NodeTypes.NT_FILE))
+ Node parentNode = (Node)curSession.getItem(repoPath);
+ if (parentNode.isNodeType(FtpConst.NodeTypes.NT_FILE))
+ {
+ return true;
+ }
+ }
+ else
{
- return true;
+ return false;
}
}
catch (PathNotFoundException exc)
Show replies by date