Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2007 BEA Systems, Inc. and others. |
2 |
* Copyright (c) 2007-2013 BEA Systems, Inc. and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 7-12
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* BEA Systems, Inc. - initial API and implementation |
9 |
* BEA Systems, Inc. - initial API and implementation |
|
|
10 |
* Fred Bricon (Red Hat, Inc.) - 359385 : override classpath entry's archive name |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
package org.eclipse.jst.j2ee.classpathdep; |
12 |
package org.eclipse.jst.j2ee.classpathdep; |
12 |
|
13 |
|
Lines 17-22
Link Here
|
17 |
import java.util.LinkedHashMap; |
18 |
import java.util.LinkedHashMap; |
18 |
import java.util.List; |
19 |
import java.util.List; |
19 |
import java.util.Map; |
20 |
import java.util.Map; |
|
|
21 |
|
20 |
import org.eclipse.core.resources.IContainer; |
22 |
import org.eclipse.core.resources.IContainer; |
21 |
import org.eclipse.core.resources.IFile; |
23 |
import org.eclipse.core.resources.IFile; |
22 |
import org.eclipse.core.resources.IProject; |
24 |
import org.eclipse.core.resources.IProject; |
Lines 631-637
public static IPath calculateDefaultRuntimePath(IVirtualComponent parentComponen
Link Here
|
631 |
} |
633 |
} |
632 |
|
634 |
|
633 |
/** |
635 |
/** |
634 |
* Retrieves the archive name for the specified classpath entry |
636 |
* Retrieves the archive name for the specified classpath entry. |
|
|
637 |
* For library entries, if a classpath attribute with {@link IClasspathDependencyConstants.CLASSPATH_ARCHIVENAME_ATTRIBUTE} was set, |
638 |
* its value will be returned. |
639 |
* |
635 |
* @param entry The entry. |
640 |
* @param entry The entry. |
636 |
* @return The archive name. |
641 |
* @return The archive name. |
637 |
*/ |
642 |
*/ |
Lines 647-656
public static String getArchiveName(final IClasspathEntry entry) {
Link Here
|
647 |
} |
652 |
} |
648 |
return resource.getFullPath().toString(); |
653 |
return resource.getFullPath().toString(); |
649 |
} |
654 |
} |
|
|
655 |
|
656 |
//bug 359385 : Override default archive name |
657 |
String customArchiveName = getCustomArchiveName(entry); |
658 |
if (customArchiveName != null) { |
659 |
return customArchiveName; |
660 |
} |
650 |
final IPath entryLocation = getEntryLocation(entry); |
661 |
final IPath entryLocation = getEntryLocation(entry); |
651 |
return entryLocation.lastSegment(); |
662 |
return entryLocation.lastSegment(); |
652 |
} |
663 |
} |
653 |
|
664 |
|
|
|
665 |
private static String getCustomArchiveName(IClasspathEntry entry) { |
666 |
IClasspathAttribute[] extraAttributes = entry.getExtraAttributes(); |
667 |
if (extraAttributes != null) { |
668 |
for (IClasspathAttribute cpa : extraAttributes) { |
669 |
if (cpa != null && CLASSPATH_ARCHIVENAME_ATTRIBUTE.equals(cpa.getName())) { |
670 |
return cpa.getValue(); |
671 |
} |
672 |
} |
673 |
} |
674 |
return null; |
675 |
} |
654 |
|
676 |
|
655 |
|
677 |
|
656 |
/** |
678 |
/** |