[teiid-issues] [JBoss JIRA] Commented: (TEIID-427) Access file error exception when RuntimeIndexSelector trying to load indexes from zip file
Salvatore Incandela (JIRA)
jira-events at lists.jboss.org
Thu Mar 19 13:29:22 EDT 2009
[ https://jira.jboss.org/jira/browse/TEIID-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12458209#action_12458209 ]
Salvatore Incandela commented on TEIID-427:
-------------------------------------------
Hi Steven, the vdb was created by teiid designer.
> Access file error exception when RuntimeIndexSelector trying to load indexes from zip file
> ------------------------------------------------------------------------------------------
>
> Key: TEIID-427
> URL: https://jira.jboss.org/jira/browse/TEIID-427
> Project: Teiid
> Issue Type: Bug
> Components: Common
> Affects Versions: 6.0.0
> Environment: Ubuntu 8.10, Eclipse 3.4.2, Java 1.6.0.12
> Reporter: Salvatore Incandela
> Assignee: Steven Hawkins
> Fix For: 6.0.0
>
>
> loadIndexesFromZipFile() method extract folders as file, during the unzip process, this cause an access file error, because the directories will included into the array indexes.
> [code]
> File entryFile = new File(getIndexDirectoryPath(), entry.getName());
> FileUtils.write(zipInputStream, entryFile, length);
> if (SimpleIndexUtil.indexFileExists(entryFile)) {
> tmp.add(new Index(entryFile.getAbsolutePath(), true));
> }
> [/code]
> I tried this solution, it seems to work:
> [code]
> File entryFile = new File(getIndexDirectoryPath(), entry.getName());
> if (entry.isDirectory()) {
> entryFile.mkdir();
> } else {
> FileUtils.write(zipInputStream, entryFile, length);
> }
> if (SimpleIndexUtil.indexFileExists(entryFile)) {
> tmp.add(new Index(entryFile.getAbsolutePath(), true));
> }
> [/code]
> In this case the indexFileExist() excludes all the directories, form the array indexes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the teiid-issues
mailing list