You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "J.W. Janssen (JIRA)" <ji...@apache.org> on 2014/12/04 13:10:13 UTC

[jira] [Created] (FELIX-4719) SnapshotCommand never properly restores archived data-areas

J.W. Janssen created FELIX-4719:
-----------------------------------

             Summary: SnapshotCommand never properly restores archived data-areas
                 Key: FELIX-4719
                 URL: https://issues.apache.org/jira/browse/FELIX-4719
             Project: Felix
          Issue Type: Bug
          Components: Deployment Admin
            Reporter: J.W. Janssen
            Assignee: J.W. Janssen


The {{RestoreSnapshotRunnable}} task that is used by {{SnapshotCommand}} to restore the data area of a bundle cannot ever work:
{code}
private void unpack(File source, File target) throws IOException {
  ZipInputStream input = null;
  try {
    input = new ZipInputStream(new FileInputStream(source));
    for (ZipEntry entry = input.getNextEntry(); entry != null; entry = input.getNextEntry()) {
      if (entry.isDirectory()) {
        (new File(target, entry.getName())).mkdirs();
      } else {
        OutputStream output = null;
        try {
          output = new FileOutputStream(target);
// THIS:                                ^^^^^^
// ...
{code}

Given that {{target}} is *always* a directory, the marked line above will never succeed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)