1 19 20 package org.netbeans.core.startup; 21 22 28 import org.openide.modules.SpecificationVersion; 29 30 39 40 public final class ModuleHistory { 41 42 private final String jar; 43 private int oldMajorVers; 44 private SpecificationVersion oldSpecVers; 45 private boolean upgraded; 46 private byte[] installerState; 47 private boolean installerStateChanged = false; 48 49 52 public ModuleHistory(String jar) { 53 assert jar != null; 54 this.jar = jar; 55 upgraded = false; 56 oldMajorVers = -1; 57 oldSpecVers = null; 58 installerState = null; 59 } 60 61 65 String getJar() { 66 return jar; 67 } 68 69 70 boolean isPreviouslyInstalled() { 71 return upgraded; 72 } 73 74 78 int getOldMajorVersion() { 79 return oldMajorVers; 80 } 81 82 86 SpecificationVersion getOldSpecificationVersion() { 87 return oldSpecVers; 88 } 89 90 93 void upgrade(int oldMajorVersion, SpecificationVersion oldSpecificationVersion) { 94 upgraded = true; 95 oldMajorVers = oldMajorVersion; 96 oldSpecVers = oldSpecificationVersion; 97 } 98 99 103 byte[] getInstallerState() { 104 return installerState; 105 } 106 107 112 void setInstallerState(byte[] state) { 113 if (installerState != null && state != null) { 114 installerStateChanged = true; 115 } 116 installerState = state; 117 } 118 119 120 boolean getInstallerStateChanged() { 121 return installerStateChanged; 122 } 123 124 125 void resetHistory() { 126 upgraded = false; 127 installerState = null; 128 installerStateChanged = false; 129 } 130 131 } 132 | Popular Tags |