[
https://jira.jboss.org/jira/browse/TEIID-427?page=com.atlassian.jira.plug...
]
Salvatore Incandela reopened TEIID-427:
---------------------------------------
I've seen that the applied patch is:
[code]
File entryFile = new File(getIndexDirectoryPath(), entry.getName());
if (entryFile.isDirectory()) {
entryFile.mkdir();
} else {
FileUtils.write(zipInputStream, entryFile, length);
}
if (SimpleIndexUtil.indexFileExists(entryFile)) {
tmp.add(new Index(entryFile.getAbsolutePath(), true));
}
[/code]
This not solve the problem, because the entryFile is not already created at this point
("entryFile.isDirectory()", as java.io.File javadoc says, will returns always
false), then all entries will be created as files.
The right patch is:
[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]
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