Lines 81-87
Link Here
|
81 |
ArchiveEntry curEntry; |
81 |
ArchiveEntry curEntry; |
82 |
|
82 |
|
83 |
/** current list of extended properties */ |
83 |
/** current list of extended properties */ |
84 |
private static Map extendedProperties = new HashMap(); |
84 |
private static final Map extendedProperties = new HashMap(); |
85 |
|
85 |
|
86 |
/** Creates jar creator instance with asociated content. |
86 |
/** Creates jar creator instance with asociated content. |
87 |
* @param ad Asociated content described by the descriptor |
87 |
* @param ad Asociated content described by the descriptor |
Lines 808-818
Link Here
|
808 |
* </folder> |
808 |
* </folder> |
809 |
* </PRE> |
809 |
* </PRE> |
810 |
*/ |
810 |
*/ |
811 |
synchronized static public boolean addExtendedProperty( |
811 |
static public boolean addExtendedProperty( |
812 |
ExtendedPropertyFactory option) { |
812 |
ExtendedPropertyFactory option) { |
813 |
String name = option.getName(); |
813 |
String name = option.getName(); |
|
|
814 |
synchronized (extendedProperties) { |
814 |
Object oldFactory = extendedProperties.put(name, option); |
815 |
Object oldFactory = extendedProperties.put(name, option); |
815 |
return (oldFactory != option); |
816 |
return (oldFactory != option); |
|
|
817 |
} |
816 |
} |
818 |
} |
817 |
|
819 |
|
818 |
/** remove a extended property |
820 |
/** remove a extended property |
Lines 820-834
Link Here
|
820 |
* @return true if property was removed; false if it did not exist |
822 |
* @return true if property was removed; false if it did not exist |
821 |
* @deprecated Please use declarative registration using layers. Folder JarPackager/ExtendedProperties |
823 |
* @deprecated Please use declarative registration using layers. Folder JarPackager/ExtendedProperties |
822 |
*/ |
824 |
*/ |
823 |
synchronized static public boolean removeExtendedProperty(String name){ |
825 |
static public boolean removeExtendedProperty(String name){ |
|
|
826 |
synchronized (extendedProperties) { |
824 |
return (extendedProperties.remove(name) != null); |
827 |
return (extendedProperties.remove(name) != null); |
|
|
828 |
} |
825 |
} |
829 |
} |
826 |
|
830 |
|
827 |
/** get current map of all current extended properties |
831 |
/** get current map of all current extended properties |
828 |
* |
832 |
* |
829 |
*/ |
833 |
*/ |
830 |
synchronized static Map getExtendedProperties() { |
834 |
static Map getExtendedProperties() { |
831 |
HashMap map = new HashMap(extendedProperties); |
835 |
// #25293: avoid excessive locking as DS API calls might go through here |
|
|
836 |
HashMap map; |
837 |
synchronized (extendedProperties) { |
838 |
map = new HashMap(extendedProperties); |
839 |
} |
832 |
FileSystem defFs = TopManager.getDefault().getRepository().getDefaultFileSystem(); |
840 |
FileSystem defFs = TopManager.getDefault().getRepository().getDefaultFileSystem(); |
833 |
FileObject fo = defFs.findResource(EXTENDED_PROPERTIES_FOLDER_NAME); //NOI18N |
841 |
FileObject fo = defFs.findResource(EXTENDED_PROPERTIES_FOLDER_NAME); //NOI18N |
834 |
if (fo != null) { |
842 |
if (fo != null) { |