Refresh metodi controllo filepath x evitare errori...

This commit is contained in:
Samuele E. Locatelli
2019-11-30 09:37:08 +01:00
parent ad8b41daec
commit 07f1a53918
2 changed files with 29 additions and 6 deletions
Vendored
+1 -1
View File
@@ -11,7 +11,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=701']) {
withEnv(['NEXT_BUILD_NUMBER=702']) {
// env.versionNumber = VersionNumber(versionNumberString : '3.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '3.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.versionNumberBeta = VersionNumber(versionNumberString : '3.5.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
+28 -5
View File
@@ -102,14 +102,30 @@ namespace SteamWare
private FileInfo getFileInfoByName(string _nomeFile)
{
FileInfo _fi;
try
// se nomefile contiene "/" --> faccio mappath altrimenti è percorso fisico...
if (_nomeFile.IndexOf("/") >= 0)
{
_fi = new FileInfo(System.Web.HttpContext.Current.Server.MapPath(_workPath + "\\" + _nomeFile));
try
{
_fi = new FileInfo(System.Web.HttpContext.Current.Server.MapPath(_workPath + "\\" + _nomeFile));
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in recupero info file:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
_fi = new FileInfo(_workPath + "\\" + _nomeFile);
}
}
catch (Exception exc)
else
{
logger.lg.scriviLog(string.Format("Errore in recupero info file:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
_fi = new FileInfo(_workPath + "\\" + _nomeFile);
try
{
_fi = new FileInfo(_nomeFile);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in recupero info file:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
_fi = new FileInfo(_workPath + "\\" + _nomeFile);
}
}
return _fi;
}
@@ -420,7 +436,14 @@ namespace SteamWare
fatto = true;
}
catch
{ }
if (fatto)
{
logger.lg.scriviLog($"Eliminazione file {_nomeFile} eseguita");
}
else
{
logger.lg.scriviLog($"impossibile Eliminare il file {_nomeFile}");
}
return fatto;
}