import org.tizen.common.core.command.policy.MessagePolicy;
import org.tizen.common.file.FileHandler;
import org.tizen.common.file.FileHandler.Attribute;
+import org.tizen.common.file.FileHandler.Type;
import org.tizen.common.sign.exception.CertificationException;
import org.tizen.common.sign.preferences.SigningProfileItem;
import org.tizen.common.sign.signer.TizenSigner;
+import org.tizen.common.sign.util.SignatureUtility;
import org.tizen.common.util.Assert;
+import org.tizen.common.util.FileUtil;
import org.tizen.common.util.StringUtil;
// categorize profile
categorizeProfiles();
+ // remove old signatures
+ for ( String child : handler.list( appDirPath ) ) {
+ Object type = handler.get( child, Attribute.TYPE );
+ if ( Type.FILE.equals( type ) ) {
+ Object nameObj = handler.get( child, Attribute.NAME );
+ if ( nameObj instanceof String ) {
+ String name = (String) nameObj;
+ if ( SignatureUtility.isSignatureFile( name ) ) {
+ handler.removeFile( child );
+ }
+ }
+ }
+ }
+
StopWatch stopWatch = new StopWatch();
try {
stopWatch.start();
@Override
public void removeFile(String path) throws IOException {
- throw new UnsupportedOperationException();
+ final IResource file = getResource( path );
+
+ if ( file.getType() != IResource.FILE )
+ {
+ throw new IOException();
+ }
+
+ try {
+ file.delete( true, null );
+ } catch (CoreException e) {
+ throw new IOException( e );
+ }
}
@Override
{
return file.isAccessible();
}
+ else if ( Attribute.NAME.equals( name ) )
+ {
+ return file.getName();
+ }
else if ( Attribute.WRITABLE.equals( name ) )
{
return file.isAccessible();