{
final File file = getBackend();
final File child = new File (file, name);
if (child.exists() == false)
{
throw new ContentIOException("Not found.");
}
try
{
if (IOUtils.getInstance().isSubDirectory(file, child))
{
throw new ContentIOException("Not sub-directory");
}
}
catch (IOException e)
{
throw new ContentIOException("IO Error.");
}
if (child.isDirectory())
{
return new FileContentLocation(this, child);
}
else if (child.isFile())
{
return new FileContentItem(this, child);
}
else
{
throw new ContentIOException("Not File nor directory.");
}
}