本文整理了Java中org.pentaho.di.core.Const.getUserHomeDirectory()
方法的一些代码示例,展示了Const.getUserHomeDirectory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.getUserHomeDirectory()
方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:getUserHomeDirectory
[英]Looks up the user's home directory (or KETTLE_HOME) for every invocation. This is no longer a static property so the value may be set after this class is loaded.
[中]为每次调用查找用户的主目录(或KETTLE_home)。这不再是静态属性,因此可以在加载此类后设置该值。
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Determines the Kettle absolute directory in the user's home directory.
*
* @return The Kettle absolute directory.
*/
public static String getKettleDirectory() {
return getUserHomeDirectory() + FILE_SEPARATOR + getUserBaseDir();
}
代码示例来源:origin: pentaho/pentaho-kettle
private Optional<String> promptForLocalFile() {
String curFile = transMeta.environmentSubstitute( wFileName.getText() );
FileObject root;
try {
root = KettleVFS.getFileObject( curFile != null ? curFile : Const.getUserHomeDirectory() );
VfsFileChooserDialog vfsFileChooser = Spoon.getInstance().getVfsFileChooserDialog( root.getParent(), root );
FileObject file =
vfsFileChooser.open( getShell(), null, fileFilters, fileFilterNames, VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE );
if ( file == null ) {
return Optional.empty();
}
String filePath = getRelativePath( file.getName().toString() );
return Optional.ofNullable( filePath );
} catch ( IOException | KettleException e ) {
new ErrorDialog( getShell(),
BaseMessages.getString( PKG, "VFSFileSelection.ErrorLoadingFile.DialogTitle" ),
BaseMessages.getString( PKG, "VFSFileSelection.ErrorLoadingFile.DialogMessage" ), e );
}
return Optional.empty();
}
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent e ) {
try {
FileObject fileName = null;
try {
String curFile = wGPGLocation.getText();
if ( curFile.trim().length() > 0 ) {
fileName =
KettleVFS.getInstance().getFileSystemManager().resolveFile(
jobMeta.environmentSubstitute( wGPGLocation.getText() ) );
} else {
fileName = KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
} catch ( FileSystemException ex ) {
fileName = KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
VfsFileChooserDialog vfsFileChooser =
Spoon.getInstance().getVfsFileChooserDialog( fileName.getParent(), fileName );
FileObject selected =
vfsFileChooser.open( shell, null, EXTENSIONS, FILETYPES, VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE );
wGPGLocation.setText( selected != null ? selected.getURL().toString() : Const.EMPTY_STRING );
} catch ( FileSystemException ex ) {
ex.printStackTrace();
}
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent e ) {
try {
FileObject fileName = null;
try {
String curFile = wFilename.getText();
if ( curFile.trim().length() > 0 ) {
fileName =
KettleVFS.getInstance().getFileSystemManager().resolveFile(
jobMeta.environmentSubstitute( wFilename.getText() ) );
} else {
fileName = KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
} catch ( FileSystemException ex ) {
fileName = KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
VfsFileChooserDialog vfsFileChooser =
Spoon.getInstance().getVfsFileChooserDialog( fileName.getParent(), fileName );
FileObject selected =
vfsFileChooser.open( shell, null, EXTENSIONS, FILETYPES, VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE );
wFilename.setText( selected != null ? selected.getURL().toString() : Const.EMPTY_STRING );
} catch ( FileSystemException ex ) {
ex.printStackTrace();
}
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent e ) {
try {
FileObject fileName = null;
try {
String curFile = wFilename.getText();
if ( curFile.trim().length() > 0 ) {
fileName =
KettleVFS.getInstance().getFileSystemManager().resolveFile(
jobMeta.environmentSubstitute( wFilename.getText() ) );
} else {
fileName = KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
} catch ( FileSystemException ex ) {
fileName = KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
VfsFileChooserDialog vfsFileChooser =
Spoon.getInstance().getVfsFileChooserDialog( fileName.getParent(), fileName );
FileObject selected =
vfsFileChooser.open( shell, null, EXTENSIONS, FILETYPES, VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE );
wFilename.setText( selected != null ? selected.getURL().toString() : Const.EMPTY_STRING );
} catch ( FileSystemException ex ) {
ex.printStackTrace();
}
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent e ) {
try {
FileObject fileName = null;
try {
String curFile = wFilename.getText();
if ( curFile.trim().length() > 0 ) {
fileName =
KettleVFS.getInstance().getFileSystemManager().resolveFile(
jobMeta.environmentSubstitute( wFilename.getText() ) );
} else {
fileName = KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
} catch ( FileSystemException ex ) {
fileName = KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
VfsFileChooserDialog vfsFileChooser =
Spoon.getInstance().getVfsFileChooserDialog( fileName.getParent(), fileName );
FileObject selected =
vfsFileChooser.open( shell, null, EXTENSIONS, FILETYPES, VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE );
wFilename.setText( selected != null ? selected.getURL().toString() : Const.EMPTY_STRING );
} catch ( FileSystemException ex ) {
ex.printStackTrace();
}
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent e ) {
try {
FileObject DetachedFilename = null;
try {
String curFile = wDetachedFilename.getText();
if ( curFile.trim().length() > 0 ) {
DetachedFilename =
KettleVFS.getInstance().getFileSystemManager().resolveFile(
jobMeta.environmentSubstitute( wDetachedFilename.getText() ) );
} else {
DetachedFilename =
KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
} catch ( FileSystemException ex ) {
DetachedFilename =
KettleVFS.getInstance().getFileSystemManager().resolveFile( Const.getUserHomeDirectory() );
}
VfsFileChooserDialog vfsFileChooser =
Spoon.getInstance().getVfsFileChooserDialog( DetachedFilename.getParent(), DetachedFilename );
FileObject selected =
vfsFileChooser.open( shell, null, EXTENSIONS, FILETYPES, VfsFileChooserDialog.VFS_DIALOG_OPEN_FILE );
wDetachedFilename.setText( selected != null ? selected.getURL().toString() : Const.EMPTY_STRING );
} catch ( FileSystemException ex ) {
ex.printStackTrace();
}
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
root = KettleVFS.getFileObject( curFile != null ? curFile : Const.getUserHomeDirectory() );
代码示例来源:origin: pentaho/pentaho-kettle
root = KettleVFS.getFileObject( curFile != null ? curFile : Const.getUserHomeDirectory() );
代码示例来源:origin: pentaho/pentaho-kettle
root = KettleVFS.getFileObject( curFile != null ? curFile : Const.getUserHomeDirectory() );
代码示例来源:origin: pentaho/pentaho-kettle
root = KettleVFS.getFileObject( curFile != null ? curFile : Const.getUserHomeDirectory() );
代码示例来源:origin: pentaho/pentaho-kettle
root = KettleVFS.getFileObject( curFile != null ? curFile : Const.getUserHomeDirectory() );
代码示例来源:origin: pentaho/pentaho-kettle
root = KettleVFS.getFileObject( curFile != null ? curFile : Const.getUserHomeDirectory() );
内容来源于网络,如有侵权,请联系作者删除!