|
|
@ -141,7 +141,7 @@ func shouldFilterPath(path string) bool {
|
|
|
|
func (f *FileService) buildFileTree(node *response.FileTree, items []*files.FileInfo, op request.FileOption, level int) error {
|
|
|
|
func (f *FileService) buildFileTree(node *response.FileTree, items []*files.FileInfo, op request.FileOption, level int) error {
|
|
|
|
for _, v := range items {
|
|
|
|
for _, v := range items {
|
|
|
|
if shouldFilterPath(v.Path) {
|
|
|
|
if shouldFilterPath(v.Path) {
|
|
|
|
global.LOG.Info("File Tree: Skipping %s due to filter\n", v.Path)
|
|
|
|
global.LOG.Infof("File Tree: Skipping %s due to filter\n", v.Path)
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
childNode := response.FileTree{
|
|
|
|
childNode := response.FileTree{
|
|
|
@ -167,7 +167,7 @@ func (f *FileService) buildChildNode(childNode *response.FileTree, fileInfo *fil
|
|
|
|
subInfo, err := files.NewFileInfo(op.FileOption)
|
|
|
|
subInfo, err := files.NewFileInfo(op.FileOption)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
if os.IsPermission(err) || errors.Is(err, unix.EACCES) {
|
|
|
|
if os.IsPermission(err) || errors.Is(err, unix.EACCES) {
|
|
|
|
global.LOG.Info("File Tree: Skipping %s due to permission denied\n", fileInfo.Path)
|
|
|
|
global.LOG.Infof("File Tree: Skipping %s due to permission denied\n", fileInfo.Path)
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.LOG.Errorf("File Tree: Skipping %s due to error: %s\n", fileInfo.Path, err.Error())
|
|
|
|
global.LOG.Errorf("File Tree: Skipping %s due to error: %s\n", fileInfo.Path, err.Error())
|
|
|
|