[teiid-issues] [JBoss JIRA] Updated: (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 10:52:22 EDT 2009
[ https://jira.jboss.org/jira/browse/TEIID-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Salvatore Incandela updated TEIID-427:
--------------------------------------
Description:
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.
was:
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 a 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.
> 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
> Affects Versions: 6.0.0
> Environment: Ubuntu 8.10, Eclipse 3.4.2, Java 1.6.0.12
> Reporter: Salvatore Incandela
> Assignee: Steven Hawkins
>
> 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